Changeset 206280 in webkit
- Timestamp:
- Sep 22, 2016 3:34:02 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r206278 r206280 1 2016-09-22 Brady Eidson <beidson@apple.com> 2 3 IDBIndex.openCursor() matches indices on multiple object stores. 4 <rdar://problem/28434463> and https://bugs.webkit.org/show_bug.cgi?id=158833 5 6 Reviewed by Alex Christensen. 7 8 * storage/indexeddb/modern/multiple-objectstore-index-cursor-collision-expected.txt: Added. 9 * storage/indexeddb/modern/multiple-objectstore-index-cursor-collision-private-expected.txt: Added. 10 * storage/indexeddb/modern/multiple-objectstore-index-cursor-collision-private.html: Added. 11 * storage/indexeddb/modern/multiple-objectstore-index-cursor-collision.html: Added. 12 * storage/indexeddb/modern/resources/multiple-objectstore-index-cursor-collision.js: Added. 13 1 14 2016-09-22 Daniel Bates <dabates@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r206279 r206280 1 2016-09-22 Brady Eidson <beidson@apple.com> 2 3 IDBIndex.openCursor() matches indices on multiple object stores. 4 <rdar://problem/28434463> and https://bugs.webkit.org/show_bug.cgi?id=158833 5 6 Reviewed by Alex Christensen. 7 8 Tests: storage/indexeddb/modern/multiple-objectstore-index-cursor-collision-private.html 9 storage/indexeddb/modern/multiple-objectstore-index-cursor-collision.html 10 11 * Modules/indexeddb/server/SQLiteIDBCursor.cpp: 12 (WebCore::IDBServer::buildIndexStatement): Need to include the object store id in the statement for 13 index cursors, otherwise there will be collisions amongst multiple object stores that happen to 14 share primary keys. 15 (WebCore::IDBServer::SQLiteIDBCursor::bindArguments): 16 1 17 2016-09-22 Zalan Bujtas <zalan@apple.com> 2 18 -
trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.cpp
r199668 r206280 113 113 StringBuilder builder; 114 114 115 builder.appendLiteral("SELECT rowid, key, value FROM IndexRecords WHERE indexID = ? AND key ");115 builder.appendLiteral("SELECT rowid, key, value FROM IndexRecords WHERE indexID = ? AND objectStoreID = ? AND key "); 116 116 if (!keyRange.lowerKey.isNull() && !keyRange.lowerOpen) 117 117 builder.appendLiteral(">="); … … 261 261 LOG(IndexedDB, "Cursor is binding lower key '%s' and upper key '%s'", m_currentLowerKey.loggingString().utf8().data(), m_currentUpperKey.loggingString().utf8().data()); 262 262 263 if (m_statement->bindInt64(1, m_boundID) != SQLITE_OK) { 263 int currentBindArgument = 1; 264 265 if (m_statement->bindInt64(currentBindArgument++, m_boundID) != SQLITE_OK) { 264 266 LOG_ERROR("Could not bind id argument (bound ID)"); 265 267 return false; 266 268 } 267 269 270 if (m_indexID != IDBIndexInfo::InvalidId && m_statement->bindInt64(currentBindArgument++, m_objectStoreID) != SQLITE_OK) { 271 LOG_ERROR("Could not bind object store id argument for an index cursor"); 272 return false; 273 } 274 268 275 RefPtr<SharedBuffer> buffer = serializeIDBKeyData(m_currentLowerKey); 269 if (m_statement->bindBlob( 2, buffer->data(), buffer->size()) != SQLITE_OK) {276 if (m_statement->bindBlob(currentBindArgument++, buffer->data(), buffer->size()) != SQLITE_OK) { 270 277 LOG_ERROR("Could not create cursor statement (lower key)"); 271 278 return false; … … 273 280 274 281 buffer = serializeIDBKeyData(m_currentUpperKey); 275 if (m_statement->bindBlob( 3, buffer->data(), buffer->size()) != SQLITE_OK) {282 if (m_statement->bindBlob(currentBindArgument++, buffer->data(), buffer->size()) != SQLITE_OK) { 276 283 LOG_ERROR("Could not create cursor statement (upper key)"); 277 284 return false;
Note: See TracChangeset
for help on using the changeset viewer.