Bug 128423 - IDB: storage/indexeddb/mozilla/cursors.html fails
Summary: IDB: storage/indexeddb/mozilla/cursors.html fails
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Brady Eidson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-02-07 17:23 PST by Brady Eidson
Modified: 2014-02-08 15:57 PST (History)
4 users (show)

See Also:


Attachments
Patch v1 (9.14 KB, patch)
2014-02-07 22:00 PST, Brady Eidson
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brady Eidson 2014-02-07 17:23:29 PST
IDB: storage/indexeddb/mozilla/cursors.html fails

-For object store cursors, we forgot to set the primary key.
-For openCursor() with no results, we incorrectly return a cursor with undefined values when we're supposed to return a null cursor.
Comment 1 Radar WebKit Bug Importer 2014-02-07 17:24:22 PST
<rdar://problem/16017998>
Comment 2 Brady Eidson 2014-02-07 21:54:37 PST
(In reply to comment #0)
> -For object store cursors, we forgot to set the primary key.
> -For openCursor() with no results, we incorrectly return a cursor with undefined values when we're supposed to return a null cursor.

Also, for iterating to a targetKey, we only tested for exact matches to the target key, instead of the "next key passed the target"
Comment 3 Brady Eidson 2014-02-07 22:00:31 PST
Created attachment 223547 [details]
Patch v1
Comment 4 WebKit Commit Bot 2014-02-07 22:01:47 PST
Attachment 223547 [details] did not pass style-queue:


ERROR: Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.cpp:154:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 1 in 7 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 mitz 2014-02-08 15:39:54 PST
Comment on attachment 223547 [details]
Patch v1

View in context: https://bugs.webkit.org/attachment.cgi?id=223547&action=review

> Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.cpp:159
>              m_callbacks->onSuccess(static_cast<SharedBuffer*>(0));

Why do we need this cast? Can’t we just say nullptr? Is there some weird overloading issue?
Comment 6 Brady Eidson 2014-02-08 15:47:46 PST
(In reply to comment #5)
> (From update of attachment 223547 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=223547&action=review
> 
> > Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.cpp:159
> >              m_callbacks->onSuccess(static_cast<SharedBuffer*>(0));
> 
> Why do we need this cast? Can’t we just say nullptr? Is there some weird overloading issue?

Sadly, yes - A massive overloading issue, in fact.  If you want to cringe, take a look at IDBCallbacks.h

Thanks for the review!
Comment 7 Brady Eidson 2014-02-08 15:57:19 PST
http://trac.webkit.org/changeset/163728