Bug 76116 - IndexedDB: IDBIndex.get/getKey should yield undefined, not an error
Summary: IndexedDB: IDBIndex.get/getKey should yield undefined, not an error
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Joshua Bell
URL:
Keywords:
Depends on:
Blocks: 76198
  Show dependency treegraph
 
Reported: 2012-01-11 16:23 PST by Joshua Bell
Modified: 2012-01-17 02:52 PST (History)
4 users (show)

See Also:


Attachments
Patch (11.02 KB, patch)
2012-01-13 17:09 PST, Joshua Bell
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Bell 2012-01-11 16:23:05 PST
The spec says: "This function produces the same result if a record with the given key doesn't exist as when a record exists, but has undefined as value. If you need to tell the two situations apart, you can use openCursor with the same key."

And more specifically, the algorithms detail:
5.3 Index Referenced Value Retrieval Operation - "If no record was found, the result of this algorithm is undefined."
5.4 Index Value Retrieval Operation - "If no record was found, the result of this algorithm is undefined."

We do this correctly for IDBObjectStore.get(), but not for IDBIndex.get() and IDBIndex.getKey()
Comment 1 Joshua Bell 2012-01-11 16:59:25 PST
I have most of a patch for this one, but it turns out that slinging an "undefined key" from the back end to the front end may require some plumbing changes in the Chromium port.
Comment 2 Joshua Bell 2012-01-13 17:09:40 PST
Created attachment 122519 [details]
Patch
Comment 3 Joshua Bell 2012-01-13 17:10:26 PST
Comment on attachment 122519 [details]
Patch

Fortunately, this can be done w/o binding changes or WebKit API changes. 76075 does not appear to be so lucky.
Comment 4 WebKit Review Bot 2012-01-17 02:52:12 PST
Comment on attachment 122519 [details]
Patch

Clearing flags on attachment: 122519

Committed r105137: <http://trac.webkit.org/changeset/105137>
Comment 5 WebKit Review Bot 2012-01-17 02:52:17 PST
All reviewed patches have been landed.  Closing bug.