Modified: trunk/LayoutTests/ChangeLog (195696 => 195697)
--- trunk/LayoutTests/ChangeLog 2016-01-27 22:57:10 UTC (rev 195696)
+++ trunk/LayoutTests/ChangeLog 2016-01-27 23:03:28 UTC (rev 195697)
@@ -1,5 +1,14 @@
2016-01-27 Brady Eidson <[email protected]>
+ Modern IDB: Fix many Index tests.
+ https://bugs.webkit.org/show_bug.cgi?id=153561
+
+ Reviewed by Alex Christensen.
+
+ * platform/mac-wk1/TestExpectations:
+
+2016-01-27 Brady Eidson <[email protected]>
+
Modern IDB: Cursors are utterly broken in the SQLite backend.
https://bugs.webkit.org/show_bug.cgi?id=153558
Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (195696 => 195697)
--- trunk/LayoutTests/platform/mac-wk1/TestExpectations 2016-01-27 22:57:10 UTC (rev 195696)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations 2016-01-27 23:03:28 UTC (rev 195697)
@@ -454,24 +454,15 @@
imported/w3c/indexeddb/writer-starvation.htm [ Failure ]
storage/indexeddb/cursor-advance.html [ Failure ]
storage/indexeddb/cursor-continue-validity.html [ Failure ]
-storage/indexeddb/cursor-continue.html [ Failure ]
-storage/indexeddb/cursor-index-delete.html [ Failure ]
storage/indexeddb/cursor-primary-key-order.html [ Failure ]
-storage/indexeddb/cursor-skip-deleted.html [ Failure ]
storage/indexeddb/cursor-update.html [ Failure ]
storage/indexeddb/delete-range.html [ Failure ]
-storage/indexeddb/duplicates.html [ Failure ]
storage/indexeddb/get-keyrange.html [ Failure ]
-storage/indexeddb/index-basics.html [ Failure ]
-storage/indexeddb/index-count.html [ Failure ]
-storage/indexeddb/index-cursor.html [ Failure ]
storage/indexeddb/index-duplicate-keypaths.html [ Failure ]
storage/indexeddb/index-multientry.html [ Failure ]
storage/indexeddb/index-population.html [ Failure ]
storage/indexeddb/index-unique.html [ Failure ]
storage/indexeddb/key-generator.html [ Failure ]
-storage/indexeddb/keypath-arrays.html [ Failure ]
-storage/indexeddb/keypath-intrinsic-properties.html [ Failure ]
storage/indexeddb/lazy-index-population.html [ Failure ]
storage/indexeddb/lazy-index-types.html [ Failure ]
storage/indexeddb/modern/cursor-3.html [ Failure ]
@@ -481,38 +472,22 @@
storage/indexeddb/modern/deleteindex-2.html [ Failure ]
storage/indexeddb/modern/get-keyrange.html [ Failure ]
storage/indexeddb/modern/idbobjectstore-delete-1.html [ Failure ]
-storage/indexeddb/modern/index-1.html [ Failure ]
-storage/indexeddb/modern/index-2.html [ Failure ]
storage/indexeddb/modern/index-3.html [ Failure ]
storage/indexeddb/modern/index-4.html [ Failure ]
-storage/indexeddb/modern/index-cursor-1.html [ Failure ]
-storage/indexeddb/modern/index-cursor-2.html [ Failure ]
-storage/indexeddb/modern/index-cursor-3.html [ Failure ]
-storage/indexeddb/modern/index-get-count-basic.html [ Failure ]
storage/indexeddb/mozilla/cursor-mutation.html [ Failure ]
-storage/indexeddb/mozilla/cursor-update-updates-indexes.html [ Failure ]
storage/indexeddb/mozilla/cursors.html [ Failure ]
storage/indexeddb/mozilla/index-prev-no-duplicate.html [ Failure ]
storage/indexeddb/mozilla/indexes.html [ Failure ]
-storage/indexeddb/mozilla/object-cursors.html [ Failure ]
storage/indexeddb/objectstore-autoincrement.html [ Failure ]
storage/indexeddb/objectstore-basics.html [ Failure ]
storage/indexeddb/opencursor-key.html [ Failure ]
-storage/indexeddb/optional-arguments.html [ Failure ]
# SQLite backend tests that timeout
-crypto/subtle/rsa-indexeddb.html [ Skip ]
-imported/w3c/indexeddb/idbfactory_open12.htm [ Skip ]
-imported/w3c/indexeddb/idbobjectstore_openCursor_invalid.htm [ Skip ]
-storage/indexeddb/cursor-cast.html [ Skip ]
storage/indexeddb/modern/transaction-scheduler-1.html [ Skip ]
storage/indexeddb/modern/transaction-scheduler-2.html [ Skip ]
storage/indexeddb/modern/transaction-scheduler-5.html [ Skip ]
storage/indexeddb/modern/transaction-scheduler-6.html [ Skip ]
-storage/indexeddb/pending-activity.html [ Skip ]
storage/indexeddb/prefetch-invalidation.html [ Skip ]
-storage/indexeddb/prefetch-race.html [ Skip ]
-storage/indexeddb/request-result-cache.html [ Skip ]
storage/indexeddb/transaction-coordination-within-database.html [ Skip ]
# SQLite backend tests that crash or ASSERT
Modified: trunk/Source/WebCore/ChangeLog (195696 => 195697)
--- trunk/Source/WebCore/ChangeLog 2016-01-27 22:57:10 UTC (rev 195696)
+++ trunk/Source/WebCore/ChangeLog 2016-01-27 23:03:28 UTC (rev 195697)
@@ -1,5 +1,26 @@
2016-01-27 Brady Eidson <[email protected]>
+ Modern IDB: Fix many Index tests.
+ https://bugs.webkit.org/show_bug.cgi?id=153561
+
+ Reviewed by Alex Christensen.
+
+ No new tests (Many failing tests now pass).
+
+ * Modules/indexeddb/server/MemoryIndex.cpp:
+ (WebCore::IDBServer::MemoryIndex::getResultForKeyRange):
+
+ * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
+ (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexKey):
+ (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
+ (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
+ (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
+
+ * Modules/indexeddb/server/SQLiteIDBCursor.h:
+ (WebCore::IDBServer::SQLiteIDBCursor::didComplete):
+
+2016-01-27 Brady Eidson <[email protected]>
+
Modern IDB: Cursors are utterly broken in the SQLite backend.
https://bugs.webkit.org/show_bug.cgi?id=153558
Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp (195696 => 195697)
--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp 2016-01-27 22:57:10 UTC (rev 195696)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp 2016-01-27 23:03:28 UTC (rev 195697)
@@ -111,7 +111,7 @@
IDBGetResult MemoryIndex::getResultForKeyRange(IndexedDB::IndexRecordType type, const IDBKeyRangeData& range) const
{
- LOG(IndexedDB, "MemoryIndex::getResultForKeyRange");
+ LOG(IndexedDB, "MemoryIndex::getResultForKeyRange - %s", range.loggingString().utf8().data());
if (!m_records)
return { };
Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp (195696 => 195697)
--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp 2016-01-27 22:57:10 UTC (rev 195696)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp 2016-01-27 23:03:28 UTC (rev 195697)
@@ -838,10 +838,10 @@
{
if (!info.multiEntry()) {
auto error = uncheckedPutIndexRecord(info.objectStoreIdentifier(), info.identifier(), key, indexKey.asOneKey());
- if (!error.isNull()) {
+ if (!error.isNull())
LOG_ERROR("Unable to put index record for newly created index");
- return error;
- }
+
+ return error;
}
Vector<IDBKeyData> indexKeys = indexKey.multiEntry();
@@ -871,6 +871,8 @@
IDBError SQLiteIDBBackingStore::uncheckedPutIndexRecord(int64_t objectStoreID, int64_t indexID, const WebCore::IDBKeyData& keyValue, const WebCore::IDBKeyData& indexKey)
{
+ LOG(IndexedDB, "SQLiteIDBBackingStore::uncheckedPutIndexRecord - %s, %s", keyValue.loggingString().utf8().data(), indexKey.loggingString().utf8().data());
+
RefPtr<SharedBuffer> indexKeyBuffer = serializeIDBKeyData(indexKey);
if (!indexKeyBuffer) {
LOG_ERROR("Unable to serialize index key to be stored in the database");
@@ -1213,7 +1215,8 @@
IDBError SQLiteIDBBackingStore::getIndexRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreID, uint64_t indexID, IndexedDB::IndexRecordType type, const IDBKeyRangeData& range, IDBGetResult& getResult)
{
- LOG(IndexedDB, "SQLiteIDBBackingStore::getIndexRecord");
+ LOG(IndexedDB, "SQLiteIDBBackingStore::getIndexRecord - %s", range.loggingString().utf8().data());
+
ASSERT(m_sqliteDB);
ASSERT(m_sqliteDB->isOpen());
@@ -1229,11 +1232,20 @@
return { IDBDatabaseException::UnknownError, ASCIILiteral("Cannot open cursor to perform index get in database") };
}
- if (type == IndexedDB::IndexRecordType::Key)
- getResult = { cursor->currentPrimaryKey() };
+ if (cursor->didError()) {
+ LOG_ERROR("Cursor failed while looking up index record in database");
+ return { IDBDatabaseException::UnknownError, ASCIILiteral("Cursor failed while looking up index record in database") };
+ }
+
+ if (cursor->didComplete())
+ getResult = { };
else {
- getResult = { SharedBuffer::create(cursor->currentValueBuffer().data(), cursor->currentValueBuffer().size()) };
- getResult.setKeyData(cursor->currentPrimaryKey());
+ if (type == IndexedDB::IndexRecordType::Key)
+ getResult = { cursor->currentPrimaryKey() };
+ else {
+ getResult = { SharedBuffer::create(cursor->currentValueBuffer().data(), cursor->currentValueBuffer().size()) };
+ getResult.setKeyData(cursor->currentPrimaryKey());
+ }
}
return { };
@@ -1412,6 +1424,8 @@
IDBError SQLiteIDBBackingStore::iterateCursor(const IDBResourceIdentifier& transactionIdentifier, const IDBResourceIdentifier& cursorIdentifier, const IDBKeyData& key, uint32_t count, IDBGetResult& result)
{
+ LOG(IndexedDB, "SQLiteIDBBackingStore::iterateCursor");
+
ASSERT(m_sqliteDB);
ASSERT(m_sqliteDB->isOpen());
Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.h (195696 => 195697)
--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.h 2016-01-27 22:57:10 UTC (rev 195696)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.h 2016-01-27 23:03:28 UTC (rev 195697)
@@ -64,6 +64,7 @@
bool advance(uint64_t count);
bool iterate(const IDBKeyData& targetKey);
+ bool didComplete() const { return m_completed; }
bool didError() const { return m_errored; }
void objectStoreRecordsChanged();