Changeset 207209 in webkit


Ignore:
Timestamp:
Oct 12, 2016 1:41:48 AM (7 years ago)
Author:
matthew_hanson@apple.com
Message:

Merge r206280. rdar://problem/28476953

Location:
branches/safari-602-branch
Files:
5 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-602-branch/LayoutTests/ChangeLog

    r207208 r207209  
     12016-10-12  Matthew Hanson  <matthew_hanson@apple.com>
     2
     3        Merge r206280. rdar://problem/28476953
     4
     5    2016-09-22  Brady Eidson  <beidson@apple.com>
     6
     7            IDBIndex.openCursor() matches indices on multiple object stores.
     8            <rdar://problem/28434463> and https://bugs.webkit.org/show_bug.cgi?id=158833
     9
     10            Reviewed by Alex Christensen.
     11
     12            * storage/indexeddb/modern/multiple-objectstore-index-cursor-collision-expected.txt: Added.
     13            * storage/indexeddb/modern/multiple-objectstore-index-cursor-collision-private-expected.txt: Added.
     14            * storage/indexeddb/modern/multiple-objectstore-index-cursor-collision-private.html: Added.
     15            * storage/indexeddb/modern/multiple-objectstore-index-cursor-collision.html: Added.
     16            * storage/indexeddb/modern/resources/multiple-objectstore-index-cursor-collision.js: Added.
     17
    1182016-10-12  Matthew Hanson  <matthew_hanson@apple.com>
    219
  • branches/safari-602-branch/Source/WebCore/ChangeLog

    r207208 r207209  
     12016-10-12  Matthew Hanson  <matthew_hanson@apple.com>
     2
     3        Merge r206280. rdar://problem/28476953
     4
     5    2016-09-22  Brady Eidson  <beidson@apple.com>
     6
     7            IDBIndex.openCursor() matches indices on multiple object stores.
     8            <rdar://problem/28434463> and https://bugs.webkit.org/show_bug.cgi?id=158833
     9
     10            Reviewed by Alex Christensen.
     11
     12            Tests: storage/indexeddb/modern/multiple-objectstore-index-cursor-collision-private.html
     13                   storage/indexeddb/modern/multiple-objectstore-index-cursor-collision.html
     14
     15            * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
     16            (WebCore::IDBServer::buildIndexStatement): Need to include the object store id in the statement for
     17              index cursors, otherwise there will be collisions amongst multiple object stores that happen to
     18              share primary keys.
     19            (WebCore::IDBServer::SQLiteIDBCursor::bindArguments):
     20
    1212016-10-12  Matthew Hanson  <matthew_hanson@apple.com>
    222
  • branches/safari-602-branch/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.cpp

    r199668 r207209  
    113113    StringBuilder builder;
    114114
    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 ");
    116116    if (!keyRange.lowerKey.isNull() && !keyRange.lowerOpen)
    117117        builder.appendLiteral(">=");
     
    261261    LOG(IndexedDB, "Cursor is binding lower key '%s' and upper key '%s'", m_currentLowerKey.loggingString().utf8().data(), m_currentUpperKey.loggingString().utf8().data());
    262262
    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) {
    264266        LOG_ERROR("Could not bind id argument (bound ID)");
    265267        return false;
    266268    }
    267269
     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
    268275    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) {
    270277        LOG_ERROR("Could not create cursor statement (lower key)");
    271278        return false;
     
    273280
    274281    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) {
    276283        LOG_ERROR("Could not create cursor statement (upper key)");
    277284        return false;
Note: See TracChangeset for help on using the changeset viewer.