Bug 128423

Summary: IDB: storage/indexeddb/mozilla/cursors.html fails
Product: WebKit Reporter: Brady Eidson <beidson>
Component: WebKit2Assignee: Brady Eidson <beidson>
Status: RESOLVED FIXED    
Severity: Normal CC: alecflett, commit-queue, jsbell, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch v1 mitz: review+

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