IDB: storage/indexeddb/mozilla/object-store-inline-autoincrement-key-added-on-put...
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Feb 2014 05:17:15 +0000 (05:17 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Feb 2014 05:17:15 +0000 (05:17 +0000)
<rdar://problem/16033286> and https://bugs.webkit.org/show_bug.cgi?id=128574

Reviewed by Maciej Stachowiak.

Source/WebKit2:

* DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
(WebKit::UniqueIDBDatabase::getRecordFromBackingStore): If there is no value in an object-store get,
  don’t return *any* results.

LayoutTests:

* platform/mac-wk2/TestExpectations:  Add the test (still skipped for now due to unrelated reasons).

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@163857 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/mac-wk2/TestExpectations
Source/WebKit2/ChangeLog
Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp

index eb4574b..295d957 100644 (file)
@@ -1,3 +1,12 @@
+2014-02-10  Brady Eidson  <beidson@apple.com>
+
+        IDB: storage/indexeddb/mozilla/object-store-inline-autoincrement-key-added-on-put.html fails
+        <rdar://problem/16033286> and https://bugs.webkit.org/show_bug.cgi?id=128574
+
+        Reviewed by Maciej Stachowiak.
+
+        * platform/mac-wk2/TestExpectations:  Add the test (still skipped for now due to unrelated reasons).
+
 2014-02-10  Benjamin Poulain  <benjamin@webkit.org>
 
         Add the basic infrastructure to compile attributes matching in selectors
index eb47adb..4419b37 100644 (file)
@@ -482,6 +482,7 @@ fullscreen/anonymous-block-merge-crash.html [ Pass ]
 # storage/indexeddb/mozilla/index-prev-no-duplicate.html [ Pass ]
 # storage/indexeddb/mozilla/indexes.html [ Pass ]
 # storage/indexeddb/mozilla/object-cursors.html [ Pass ]
+# storage/indexeddb/mozilla/object-store-inline-autoincrement-key-added-on-put.html [ Pass ]
 # storage/indexeddb/mozilla/object-store-remove-values.html [ Pass ]
 # storage/indexeddb/mozilla/versionchange-abort.html [ Pass ]
 
index f159fef..448862e 100644 (file)
@@ -1,3 +1,14 @@
+2014-02-10  Brady Eidson  <beidson@apple.com>
+
+        IDB: storage/indexeddb/mozilla/object-store-inline-autoincrement-key-added-on-put.html fails
+        <rdar://problem/16033286> and https://bugs.webkit.org/show_bug.cgi?id=128574
+
+        Reviewed by Maciej Stachowiak.
+
+        * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
+        (WebKit::UniqueIDBDatabase::getRecordFromBackingStore): If there is no value in an object-store get,
+          don’t return *any* results.
+
 2014-02-10  Benjamin Poulain  <bpoulain@apple.com>
 
         Fix the iOS build after r163848
index 4472580..7fbac7b 100644 (file)
@@ -905,8 +905,10 @@ void UniqueIDBDatabase::getRecordFromBackingStore(uint64_t requestID, const IDBI
         if (keyRange->isOnlyKey()) {
             if (!m_backingStore->getKeyRecordFromObjectStore(transaction, objectStoreMetadata.id, *keyRange->lower(), result))
                 postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didGetRecordFromBackingStore, requestID, IDBGetResult(), IDBDatabaseException::UnknownError, ASCIILiteral("Failed to get key record from object store in backing store")));
-            else
-                postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didGetRecordFromBackingStore, requestID, IDBGetResult(result.release()), 0, String(StringImpl::empty())));
+            else {
+                IDBGetResult getResult = result ? IDBGetResult(result.release(), keyRange->lower(), objectStoreMetadata.keyPath) : IDBGetResult();
+                postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didGetRecordFromBackingStore, requestID, getResult, 0, String(StringImpl::empty())));
+            }
 
             return;
         }
@@ -915,8 +917,10 @@ void UniqueIDBDatabase::getRecordFromBackingStore(uint64_t requestID, const IDBI
 
         if (!m_backingStore->getKeyRangeRecordFromObjectStore(transaction, objectStoreMetadata.id, *keyRange, result, resultKey))
             postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didGetRecordFromBackingStore, requestID, IDBGetResult(), IDBDatabaseException::UnknownError, ASCIILiteral("Failed to get key range record from object store in backing store")));
-        else
-            postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didGetRecordFromBackingStore, requestID, IDBGetResult(result.release(), resultKey.release(), IDBKeyPath()), 0, String(StringImpl::empty())));
+        else {
+            IDBGetResult getResult = result ? IDBGetResult(result.release(), resultKey.release(), objectStoreMetadata.keyPath) : IDBGetResult();
+            postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didGetRecordFromBackingStore, requestID, getResult, 0, String(StringImpl::empty())));
+        }
 
         return;
     }