Title: [163172] trunk/Source/WebKit2
Revision
163172
Author
[email protected]
Date
2014-01-31 09:03:17 -0800 (Fri, 31 Jan 2014)

Log Message

IDB: When deleting object stores/indexes, also delete associated records
https://bugs.webkit.org/show_bug.cgi?id=127872

Reviewed by Anders Carlsson.

This was mostly done via other patches, but clearObjectStore was the last remaining case:
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::clearObjectStore): Also delete Index records.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (163171 => 163172)


--- trunk/Source/WebKit2/ChangeLog	2014-01-31 16:48:55 UTC (rev 163171)
+++ trunk/Source/WebKit2/ChangeLog	2014-01-31 17:03:17 UTC (rev 163172)
@@ -1,5 +1,16 @@
 2014-01-31  Brady Eidson  <[email protected]>
 
+        IDB: When deleting object stores/indexes, also delete associated records
+        https://bugs.webkit.org/show_bug.cgi?id=127872
+
+        Reviewed by Anders Carlsson.
+
+        This was mostly done via other patches, but clearObjectStore was the last remaining case:
+        * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
+        (WebKit::UniqueIDBDatabaseBackingStoreSQLite::clearObjectStore): Also delete Index records.
+
+2014-01-31  Brady Eidson  <[email protected]>
+
         IDB: Index writing
         <rdar://problem/15899973> and https://bugs.webkit.org/show_bug.cgi?id=127868
 

Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp (163171 => 163172)


--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp	2014-01-31 16:48:55 UTC (rev 163171)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp	2014-01-31 17:03:17 UTC (rev 163172)
@@ -558,7 +558,16 @@
         }
     }
 
-    // FIXME <rdar://problem/15779642>: Once indexes are implemented, drop index records.
+    {
+        SQLiteStatement sql(*m_sqliteDB, ASCIILiteral("DELETE FROM IndexRecords WHERE objectStoreID = ?;"));
+        if (sql.prepare() != SQLResultOk
+            || sql.bindInt64(1, objectStoreID) != SQLResultOk
+            || sql.step() != SQLResultDone) {
+            LOG_ERROR("Could not delete records from index record store id %lli (%i) - %s", objectStoreID, m_sqliteDB->lastError(), m_sqliteDB->lastErrorMsg());
+            return false;
+        }
+    }
+
     return true;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to