Modern IDB: storage/indexeddb/index-duplicate-keypaths.html fails.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 12 Dec 2015 22:03:09 +0000 (22:03 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 12 Dec 2015 22:03:09 +0000 (22:03 +0000)
commit46c824f3e5f5644f952ef3356a059bfbc3d07136
tree57d2b735e71d4cd793169ecf28f5f2347f1e9f61
parent63e6af1e487a3f4dc1728cebefcb3363ed96efbf
Modern IDB: storage/indexeddb/index-duplicate-keypaths.html fails.
https://bugs.webkit.org/show_bug.cgi?id=152201

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (At least one failing test now passes).

The spec states that if an object store uses a key generator, and then a record is stored whose
key was an explicitly set number, then the key generator value should be bumped to the next
integer higher than the explicit number.

We didn't do that.

Now we do.

* Modules/indexeddb/IndexedDB.h: Add an "OverwriteForCursor" option for overwrite mode.

* Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
(WebCore::IDBClient::IDBObjectStore::putForCursorUpdate): Use the "OverwriteForCursor" mode.

* Modules/indexeddb/server/IDBBackingStore.h: Add maybeUpdateKeyGeneratorNumber

* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::maybeUpdateKeyGeneratorNumber): If the number value
  from the provided key should bump the key generator value, do so now.
* Modules/indexeddb/server/MemoryIDBBackingStore.h:

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): After successfully adding the new record,
  possibly bump the key generator value.

LayoutTests:

* platform/mac-wk1/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194010 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/mac-wk1/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IndexedDB.h
Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp
Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h
Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp
Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp