IDB: indexeddb/mozilla/add-twice-failure.html fails
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Feb 2014 00:26:59 +0000 (00:26 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Feb 2014 00:26:59 +0000 (00:26 +0000)
commitd21b986be47c6e3ff5c90b68f8c512b6d2f17bf0
treea8df05ac32ebf59cd5ffe1719f12e4fb52213d41
parent5da8dbdca6c8050f53bcd15ddd6c87a2f4230cf5
IDB: indexeddb/mozilla/add-twice-failure.html fails
<rdar://problem/15982569> and https://bugs.webkit.org/show_bug.cgi?id=128208

Reviewed by Tim Horton.

Source/WebCore:

Covered specifically by indexeddb/mozilla/add-twice-failure.html and a handful of others.

* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::onError): Improve logging.

* Modules/indexeddb/IDBTransactionBackend.cpp:
(WebCore::IDBTransactionBackend::abort): Improve logging.

* Modules/indexeddb/IDBTransactionBackendOperations.cpp:
(WebCore::PutOperation::perform): Don’t abort the transaction when an error occurred.

* WebCore.exp.in:

Source/WebKit2:

Note that besides making indexeddb/mozilla/add-twice-failure.html pass this also makes some other tests
pass and also improves the failure modes of others.

A full accounting of which tests pass is coming soon.

* DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
(WebKit::UniqueIDBDatabase::putRecordInBackingStore): After checking for existence of the key and before
  adding the record, remove any previous record. (Defined by the spec, found exploring this test).

* DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::keyExistsInObjectStore): Implement this.
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteRecord): Add a form to be used as mentioned above in
  UniqueIDBDatabase::putRecordInBackingStore.
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::getKeyRecordFromObjectStore): CAST the key argument properly.
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::getKeyRangeRecordFromObjectStore): Ditto.
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:

LayoutTests:

* platform/mac-wk2/TestExpectations: Reenable this test for WK2

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@163417 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac-wk2/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBRequest.cpp
Source/WebCore/Modules/indexeddb/IDBTransactionBackend.cpp
Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.cpp
Source/WebCore/WebCore.exp.in
Source/WebKit2/ChangeLog
Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp
Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h
Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp
Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h