WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 59822
IndexedDB does not update r/w index cursors that are mutated during iteration
https://bugs.webkit.org/show_bug.cgi?id=59822
Summary
IndexedDB does not update r/w index cursors that are mutated during iteration
Mark Pilgrim (Google)
Reported
2011-04-29 13:25:32 PDT
Original test:
http://mxr.mozilla.org/mozilla2.0/source/dom/indexedDB/test/test_cursor_mutation.html?raw=1
Ported test: see attachment The scenario here is that you have an object store with data in it, and an index on one of the fields. (In the attached test, the index is an alphabetical index of first names.) You open a read/write transaction and use it to open a cursor on the index. While iterating through the cursor (in alphabetical order), you mutate the object store to add another row whose values would not yet have shown up in iteration. Expected result: the index cursor should automatically update to include the new row when it eventually comes up in the alphabetical order (of the index). The mutation occurs before the added name would have appeared in the cursor iteration, thus the iteration should eventually find it. Actual result: WebKit's behavior is to skip over the row that was added during iteration. Iteration of the index cursor continues in the expected (alphabetical) order through the original data in the object store, but the added row is never found.
Attachments
Test case
(6.78 KB, patch)
2011-04-29 13:26 PDT
,
Mark Pilgrim (Google)
no flags
Details
Formatted Diff
Diff
updated test case
(5.56 KB, text/html)
2011-12-07 13:38 PST
,
Joshua Bell
no flags
Details
Patch
(11.41 KB, patch)
2012-01-27 15:37 PST
,
Joshua Bell
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Mark Pilgrim (Google)
Comment 1
2011-04-29 13:26:41 PDT
Created
attachment 91723
[details]
Test case
Mark Pilgrim (Google)
Comment 2
2011-04-29 13:27:45 PDT
Not a patch, just a test case. Removed spurious review flag.
David Grogan
Comment 3
2011-04-29 14:11:40 PDT
Just curious, do we correctly handle this case if the cursor is iterating over an objectstore rather than an index?
Mark Pilgrim (Google)
Comment 4
2011-05-02 06:40:11 PDT
Yes, see
bug 59933
.
Hans Wennborg
Comment 5
2011-05-03 03:00:09 PDT
(In reply to
comment #4
)
> Yes, see
bug 59933
.
Hmm, that's interesting. Thanks for finding this.
Joshua Bell
Comment 6
2011-12-07 13:38:13 PST
Created
attachment 118266
[details]
updated test case No repro for me. This may have been fixed with the move to LevelDB. The attached test case was a bit crufty; I dusted it off (attached) and it works fine.
Joshua Bell
Comment 7
2011-12-07 13:40:36 PST
On further thought, we should probably pull in this test, but perhaps keep it closer to the original moz test than my edit.
Joshua Bell
Comment 8
2012-01-27 15:37:00 PST
Created
attachment 124384
[details]
Patch
Joshua Bell
Comment 9
2012-01-27 15:37:48 PST
Comment on
attachment 124384
[details]
Patch Dusted off the original patch a bit. Still passes as expected.
David Grogan
Comment 10
2012-01-27 15:41:05 PST
Comment on
attachment 124384
[details]
Patch LGTM
WebKit Review Bot
Comment 11
2012-01-27 16:05:10 PST
Comment on
attachment 124384
[details]
Patch Clearing flags on attachment: 124384 Committed
r106165
: <
http://trac.webkit.org/changeset/106165
>
WebKit Review Bot
Comment 12
2012-01-27 16:05:15 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.
Top of Page
Format For Printing
XML
Clone This Bug