RESOLVED FIXED 72567
IndexedDB: Indexes should be secondarily sorted on primary key
https://bugs.webkit.org/show_bug.cgi?id=72567
Summary IndexedDB: Indexes should be secondarily sorted on primary key
Joshua Bell
Reported 2011-11-16 17:30:03 PST
IndexedDB: Indexes should be secondarily sorted on primary key
Attachments
Patch (15.27 KB, patch)
2011-11-16 17:30 PST, Joshua Bell
no flags
Patch (17.61 KB, patch)
2011-11-17 11:16 PST, Joshua Bell
no flags
Patch (24.15 KB, patch)
2011-11-17 12:15 PST, Joshua Bell
no flags
Patch (25.07 KB, patch)
2011-11-23 11:30 PST, Joshua Bell
no flags
Joshua Bell
Comment 1 2011-11-16 17:30:30 PST
Joshua Bell
Comment 2 2011-11-16 17:31:25 PST
I should probably add something to the IDBLevelDBCodingTest.cpp
Joshua Bell
Comment 3 2011-11-17 11:16:55 PST
Joshua Bell
Comment 4 2011-11-17 11:22:21 PST
Comment on attachment 115623 [details] Patch Ugh, I actually need to remove some of the logic around "sequence number"; it's unnecessary for new records.
Joshua Bell
Comment 5 2011-11-17 12:15:29 PST
Joshua Bell
Comment 6 2011-11-17 12:17:07 PST
Comment on attachment 115652 [details] Patch Should be good to go now, review at leisure.
Hans Wennborg
Comment 7 2011-11-21 04:02:04 PST
Comment on attachment 115652 [details] Patch Looks great, thanks for fixing this! View in context: https://bugs.webkit.org/attachment.cgi?id=115652&action=review > Source/WebCore/ChangeLog:7 > + Maybe say a few words in the Changelog about how this is implemented, i.e. that we're appending the primary key to index data keys. > Source/WebKit/chromium/ChangeLog:6 > + Reviewed by NOBODY (OOPS!). I would probably add a line saying that this updates the unit test. > Source/WebCore/storage/IDBLevelDBCoding.cpp:1429 > +Vector<char> IndexDataKey::encode(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const Vector<char>& encodedUserKey, const Vector<char>& encodedPrimaryKey, int64_t sequenceNumber) hmm, maybe we should change the parameter order here? So far, I think they've been in the same order that we encode them. > LayoutTests/storage/indexeddb/cursor-primary-key-order.html:95 > + curreq = evalAndLog("curreq = index.openCursor()"); not super happy about "curreq" as name.. cursorRequest, or just request, maybe?
Joshua Bell
Comment 8 2011-11-23 09:03:41 PST
(In reply to comment #7) > (From update of attachment 115652 [details]) > > > Source/WebCore/storage/IDBLevelDBCoding.cpp:1429 > > +Vector<char> IndexDataKey::encode(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const Vector<char>& encodedUserKey, const Vector<char>& encodedPrimaryKey, int64_t sequenceNumber) > > hmm, maybe we should change the parameter order here? So far, I think they've been in the same order that we encode them. Following this change, sequenceNumber is unnecessary except for testing; it has a default in the header, so I wanted it to be last. Alternately, I could add another overload that takes sequenceNumber in the "correct" order, that's only used for testing.
Hans Wennborg
Comment 9 2011-11-23 09:25:55 PST
(In reply to comment #8) > (In reply to comment #7) > > (From update of attachment 115652 [details] [details]) > > > > > Source/WebCore/storage/IDBLevelDBCoding.cpp:1429 > > > +Vector<char> IndexDataKey::encode(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const Vector<char>& encodedUserKey, const Vector<char>& encodedPrimaryKey, int64_t sequenceNumber) > > > > hmm, maybe we should change the parameter order here? So far, I think they've been in the same order that we encode them. > > Following this change, sequenceNumber is unnecessary except for testing; it has a default in the header, so I wanted it to be last. Didn't realize there was a default in the header. Never mind, then.
Joshua Bell
Comment 10 2011-11-23 11:30:46 PST
Joshua Bell
Comment 11 2011-11-23 11:31:45 PST
tony@ can you take a look?
WebKit Review Bot
Comment 12 2011-11-24 10:10:17 PST
Comment on attachment 116386 [details] Patch Clearing flags on attachment: 116386 Committed r101142: <http://trac.webkit.org/changeset/101142>
WebKit Review Bot
Comment 13 2011-11-24 10:10:21 PST
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.