IDB: storage/indexeddb/create-index-with-integer-keys.html fails
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Feb 2014 18:26:48 +0000 (18:26 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Feb 2014 18:26:48 +0000 (18:26 +0000)
commit059faa3c714650f7c57a3c11bfcbde5799152180
tree301fe6f0a3fefd508464fc5912b755a8866d2e4d
parent56812d26d656ad03ad6272acce3e64e98192c64b
IDB: storage/indexeddb/create-index-with-integer-keys.html fails
<rdar://problem/16002857> and https://bugs.webkit.org/show_bug.cgi?id=128316

Reviewed by Geoff Garen.

Source/WebCore:

Tested by storage/indexeddb/create-index-with-integer-keys.html (and probably some others)

* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::update): Update createIDBKeyFromScriptValueAndKeyPath usage.
(WebCore::IDBCursor::setValueReady): Update createIDBKeyFromScriptValueAndKeyPath usage.

* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::put): Update usage of binding utilities.

* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::onSuccess): Update createIDBKeyFromScriptValueAndKeyPath usage.

* bindings/js/IDBBindingUtilities.cpp:
(WebCore::internalCreateIDBKeyFromScriptValueAndKeyPath):
(WebCore::createIDBKeyFromScriptValueAndKeyPath): Changed to take an ExecState*.
(WebCore::deserializeIDBValueBuffer): Added new version that starts with ExecState* and Vector<uint8_t>
  instead of RequestState and SharedBuffer.
(WebCore::generateIndexKeysForValue): Moved from IDBObjectStore.cpp and changed to take an ExecState*
* bindings/js/IDBBindingUtilities.h:

Added new blob fetcher that works with uint8_t buffers:
* platform/sql/SQLiteStatement.cpp:
(WebCore::SQLiteStatement::getColumnBlobAsVector):
* platform/sql/SQLiteStatement.h:

* WebCore.exp.in:

Source/WebKit2:

Update Vector<char> to Vector<uint8_t> throughout:
* DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
(WebKit::UniqueIDBDatabase::openCursorInBackingStore):
(WebKit::UniqueIDBDatabase::didOpenCursorInBackingStore):
(WebKit::UniqueIDBDatabase::advanceCursorInBackingStore):
(WebKit::UniqueIDBDatabase::didAdvanceCursorInBackingStore):
(WebKit::UniqueIDBDatabase::iterateCursorInBackingStore):
(WebKit::UniqueIDBDatabase::didIterateCursorInBackingStore):
* DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:

Update Vector<char> to Vector<uint8_t> throughout:
* DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:
(WebKit::SQLiteIDBCursor::advanceOnce):
* DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.h:
(WebKit::SQLiteIDBCursor::currentValueBuffer):

* DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::createIndex): Create a script value from the value data, use
  generateIndexKeysForValue to get the index keys, and then write the resulting index records.
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::putIndexRecord): Call through to uncheckedPutIndexRecord.
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::uncheckedPutIndexRecord): Version of putIndexRecord that doesn’t
  validate the transaction or its mode.
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::openCursor): Update Vector<char> to Vector<uint8_t>.
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::advanceCursor): Ditto.
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::iterateCursor): Ditto.
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:

LayoutTests:

* platform/mac-wk2/TestExpectations: Enable the test.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@163627 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac-wk2/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBCursor.cpp
Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
Source/WebCore/Modules/indexeddb/IDBRequest.cpp
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/IDBBindingUtilities.cpp
Source/WebCore/bindings/js/IDBBindingUtilities.h
Source/WebCore/platform/sql/SQLiteStatement.cpp
Source/WebCore/platform/sql/SQLiteStatement.h
Source/WebKit2/ChangeLog
Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp
Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h
Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h
Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp
Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.h
Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp
Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h