[IndexedDB] array index keys are concatenated across cursor lifetime
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Jun 2015 20:24:55 +0000 (20:24 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Jun 2015 20:24:55 +0000 (20:24 +0000)
commit999671ccbb27567da28d1b07d78e28a839d3627d
tree449b56dd932733d13eaf2d6c7810ac61d300d1db
parentde62f825d7b236797bca506162266dda2085c560
[IndexedDB] array index keys are concatenated across cursor lifetime
<rdar://problem/19684902> and https://bugs.webkit.org/show_bug.cgi?id=138504

Reviewed by Brady Eidson, patch by Mark Dixon <mark@lowla.io>

Source/WebCore:

Tested by:
storage/indexeddb/keypath-arrays.html

IDBKeyData and IDBKeyPath need to clear any existing array values before calling
decodeObjects to update the value of an existing object.

* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::decode):
* Modules/indexeddb/IDBKeyPath.cpp:
(WebCore::IDBKeyPath::decode):

LayoutTests:

* storage/indexeddb/keypath-arrays-expected.txt:
* storage/indexeddb/resources/keypath-arrays.js:
Verify that iterating cursors with array keypaths returns correct keys for all
records, not just the first.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185604 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/storage/indexeddb/keypath-arrays-expected.txt
LayoutTests/storage/indexeddb/resources/keypath-arrays.js
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBKeyData.cpp
Source/WebCore/Modules/indexeddb/IDBKeyPath.cpp