Unreviewed, rolling out r209168.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Dec 2016 07:05:42 +0000 (07:05 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Dec 2016 07:05:42 +0000 (07:05 +0000)
Caused 2 API tests to fail

Reverted changeset:

"IndexedDB: When doing puts, don't
"updateAllIndexesForAddRecord" if there are no indexes."
https://bugs.webkit.org/show_bug.cgi?id=165215
http://trac.webkit.org/changeset/209168

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

Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp

index 8656c3a..0502c10 100644 (file)
@@ -1,3 +1,16 @@
+2016-11-30  Brady Eidson  <beidson@apple.com>
+
+        Unreviewed, rolling out r209168.
+
+        Caused 2 API tests to fail
+
+        Reverted changeset:
+
+        "IndexedDB: When doing puts, don't
+        "updateAllIndexesForAddRecord" if there are no indexes."
+        https://bugs.webkit.org/show_bug.cgi?id=165215
+        http://trac.webkit.org/changeset/209168
+
 2016-11-30  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
 
         Build break when using --minimal
index 927d492..fb6d378 100644 (file)
@@ -1660,21 +1660,19 @@ IDBError SQLiteIDBBackingStore::addRecord(const IDBResourceIdentifier& transacti
         recordID = m_sqliteDB->lastInsertRowID();
     }
 
-    if (!objectStoreInfo.indexMap().isEmpty()) {
-        auto error = updateAllIndexesForAddRecord(objectStoreInfo, keyData, value.data());
+    auto error = updateAllIndexesForAddRecord(objectStoreInfo, keyData, value.data());
 
-        if (!error.isNull()) {
-            auto* sql = cachedStatement(SQL::DeleteObjectStoreRecord, ASCIILiteral("DELETE FROM Records WHERE objectStoreID = ? AND key = CAST(? AS TEXT);"));
-            if (!sql
-                || sql->bindInt64(1, objectStoreInfo.identifier()) != SQLITE_OK
-                || sql->bindBlob(2, keyBuffer->data(), keyBuffer->size()) != SQLITE_OK
-                || sql->step() != SQLITE_DONE) {
-                LOG_ERROR("Indexing new object store record failed, but unable to remove the object store record itself");
-                return { IDBDatabaseException::UnknownError, ASCIILiteral("Indexing new object store record failed, but unable to remove the object store record itself") };
-            }
-
-            return error;
+    if (!error.isNull()) {
+        auto* sql = cachedStatement(SQL::DeleteObjectStoreRecord, ASCIILiteral("DELETE FROM Records WHERE objectStoreID = ? AND key = CAST(? AS TEXT);"));
+        if (!sql
+            || sql->bindInt64(1, objectStoreInfo.identifier()) != SQLITE_OK
+            || sql->bindBlob(2, keyBuffer->data(), keyBuffer->size()) != SQLITE_OK
+            || sql->step() != SQLITE_DONE) {
+            LOG_ERROR("Indexing new object store record failed, but unable to remove the object store record itself");
+            return { IDBDatabaseException::UnknownError, ASCIILiteral("Indexing new object store record failed, but unable to remove the object store record itself") };
         }
+
+        return error;
     }
 
     const Vector<String>& blobURLs = value.blobURLs();
@@ -1730,7 +1728,7 @@ IDBError SQLiteIDBBackingStore::addRecord(const IDBResourceIdentifier& transacti
 
     transaction->notifyCursorsOfChanges(objectStoreInfo.identifier());
 
-    return { };
+    return error;
 }
 
 IDBError SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord(int64_t objectStoreRecord, Vector<String>& blobURLs, Vector<String>& blobFilePaths)