Bug 86123

Summary: IndexedDB: Implement spec behavior for multiEntry indexes with invalid/duplicate subkeys
Product: WebKit Reporter: Joshua Bell <jsbell>
Component: WebCore Misc.Assignee: Alec Flett <alecflett>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, dglazkov, dgrogan, fishd, haraken, jamesr, japhet, jochen, jsbell, tkent+wkapi, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 86122    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch for landing none

Joshua Bell
Reported 2012-05-10 11:55:55 PDT
The spec details the handling of multiEntry key paths where the key path yields an array and the array includes values that are duplicates or invalid sub-keys. WebKit's implementation (WebCore/binding/v8/IDBBindingUtilities.cpp) yields an overall InvalidType key if any of the subkeys are invalid. http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#dfn-steps-for-storing-a-record-into-an-object-store 7.4 If index's multiEntry flag is true, and index key is an Array, remove any elements from index key that are not valid keys and remove any duplicate elements from index key such that only one instance of the duplicate value remains. For example, the following value of index key [10, 20, null, 30, 20] is converted to [10, 20, 30].
Attachments
Patch (25.62 KB, patch)
2012-06-19 12:55 PDT, Alec Flett
no flags
Patch (25.98 KB, patch)
2012-06-19 13:59 PDT, Alec Flett
no flags
Patch (26.20 KB, patch)
2012-06-19 14:30 PDT, Alec Flett
no flags
Patch (23.08 KB, patch)
2012-06-21 11:35 PDT, Alec Flett
no flags
Patch for landing (23.02 KB, patch)
2012-06-21 11:46 PDT, Joshua Bell
no flags
Alec Flett
Comment 1 2012-06-19 12:55:00 PDT
Alec Flett
Comment 2 2012-06-19 12:55:50 PDT
jsbell@ or dgrogan@ - mind a quick look?
WebKit Review Bot
Comment 3 2012-06-19 12:57:35 PDT
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
Alec Flett
Comment 4 2012-06-19 13:59:26 PDT
Joshua Bell
Comment 5 2012-06-19 14:22:25 PDT
Comment on attachment 148414 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=148414&action=review > Source/WebCore/Modules/indexeddb/IDBLevelDBCoding.cpp:393 > + ASSERT_NOT_REACHED(); Redundant with fall through. > Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:451 > + if (!m_index->addingKeyAllowed(indexKey->array()[i].get())) Ouch, good catch. > LayoutTests/storage/indexeddb/resources/index-multientry.js:124 > + }; Either put this callback all on one line, or correct the indentation.
Alec Flett
Comment 6 2012-06-19 14:30:25 PDT
Alec Flett
Comment 7 2012-06-19 14:31:27 PDT
Comment on attachment 148425 [details] Patch tkent@ - r? cq?
Alec Flett
Comment 8 2012-06-21 11:35:19 PDT
Joshua Bell
Comment 9 2012-06-21 11:46:17 PDT
Created attachment 148851 [details] Patch for landing
WebKit Review Bot
Comment 10 2012-06-21 15:28:57 PDT
Comment on attachment 148851 [details] Patch for landing Clearing flags on attachment: 148851 Committed r120967: <http://trac.webkit.org/changeset/120967>
WebKit Review Bot
Comment 11 2012-06-21 15:29:02 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.