Changeset 209168 in webkit
- Timestamp:
- Nov 30, 2016 6:42:28 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r209167 r209168 1 2016-11-30 Brady Eidson <beidson@apple.com> 2 3 IndexedDB: When doing puts, don't "updateAllIndexesForAddRecord" if there are no indexes. 4 https://bugs.webkit.org/show_bug.cgi?id=165215 5 6 Reviewed by Alex Christensen. 7 8 No new tests (No observable behavior change). 9 10 * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: 11 (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Don't "updateAllIndexesForAddRecord" if there are no indexes. 12 Avoiding this saved us some IDBKey serialization and Javascript object manipulation. 13 1 14 2016-11-30 Antoine Quint <graouts@apple.com> 2 15 -
trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp
r209160 r209168 1661 1661 } 1662 1662 1663 auto error = updateAllIndexesForAddRecord(objectStoreInfo, keyData, value.data()); 1664 1665 if (!error.isNull()) { 1666 auto* sql = cachedStatement(SQL::DeleteObjectStoreRecord, ASCIILiteral("DELETE FROM Records WHERE objectStoreID = ? AND key = CAST(? AS TEXT);")); 1667 if (!sql 1668 || sql->bindInt64(1, objectStoreInfo.identifier()) != SQLITE_OK 1669 || sql->bindBlob(2, keyBuffer->data(), keyBuffer->size()) != SQLITE_OK 1670 || sql->step() != SQLITE_DONE) { 1671 LOG_ERROR("Indexing new object store record failed, but unable to remove the object store record itself"); 1672 return { IDBDatabaseException::UnknownError, ASCIILiteral("Indexing new object store record failed, but unable to remove the object store record itself") }; 1673 } 1674 1675 return error; 1663 if (!objectStoreInfo.indexMap().isEmpty()) { 1664 auto error = updateAllIndexesForAddRecord(objectStoreInfo, keyData, value.data()); 1665 1666 if (!error.isNull()) { 1667 auto* sql = cachedStatement(SQL::DeleteObjectStoreRecord, ASCIILiteral("DELETE FROM Records WHERE objectStoreID = ? AND key = CAST(? AS TEXT);")); 1668 if (!sql 1669 || sql->bindInt64(1, objectStoreInfo.identifier()) != SQLITE_OK 1670 || sql->bindBlob(2, keyBuffer->data(), keyBuffer->size()) != SQLITE_OK 1671 || sql->step() != SQLITE_DONE) { 1672 LOG_ERROR("Indexing new object store record failed, but unable to remove the object store record itself"); 1673 return { IDBDatabaseException::UnknownError, ASCIILiteral("Indexing new object store record failed, but unable to remove the object store record itself") }; 1674 } 1675 1676 return error; 1677 } 1676 1678 } 1677 1679 … … 1729 1731 transaction->notifyCursorsOfChanges(objectStoreInfo.identifier()); 1730 1732 1731 return error;1733 return { }; 1732 1734 } 1733 1735
Note: See TracChangeset
for help on using the changeset viewer.