Changeset 195801 in webkit


Ignore:
Timestamp:
Jan 28, 2016 10:50:40 PM (8 years ago)
Author:
beidson@apple.com
Message:

Modern IDB: SQLite backend mismanages key generator values.
https://bugs.webkit.org/show_bug.cgi?id=153625

Reviewed by Andy Estes.

Source/WebCore:

No new tests (Many failing tests pass, a few get closer).

There's mixed assumptions about whether the value stored is the current value or the next value.

Fixing those assumptions fixes tests.

  • Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:

(WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber): Store/retrieve the correct value.
(WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber): Ditto.
(WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber): Ditto.

LayoutTests:

  • platform/mac-wk1/TestExpectations:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r195799 r195801  
     12016-01-28  Brady Eidson  <beidson@apple.com>
     2
     3        Modern IDB: SQLite backend mismanages key generator values.
     4        https://bugs.webkit.org/show_bug.cgi?id=153625
     5
     6        Reviewed by Andy Estes.
     7
     8        * platform/mac-wk1/TestExpectations:
     9
    1102016-01-28  Joseph Pecoraro  <pecoraro@apple.com>
    211
  • trunk/LayoutTests/platform/mac-wk1/TestExpectations

    r195796 r195801  
    257257crypto/subtle/rsa-indexeddb-non-exportable.html [ Failure ]
    258258fast/history/page-cache-indexed-opened-db.html [ Failure ]
    259 imported/w3c/indexeddb/idbdatabase_deleteObjectStore4-not_reused.htm [ Failure ]
    260259imported/w3c/indexeddb/idbindex-multientry-big.htm [ Failure ]
    261 imported/w3c/indexeddb/keygenerator-constrainterror.htm [ Failure ]
    262 imported/w3c/indexeddb/keygenerator.htm [ Failure ]
    263 imported/w3c/indexeddb/transaction-requestqueue.htm [ Failure ]
    264260storage/indexeddb/cursor-continue-validity.html [ Failure ]
    265261storage/indexeddb/cursor-primary-key-order.html [ Failure ]
    266262storage/indexeddb/get-keyrange.html [ Failure ]
    267 storage/indexeddb/index-duplicate-keypaths.html [ Failure ]
    268 storage/indexeddb/key-generator.html [ Failure ]
    269263storage/indexeddb/modern/get-keyrange.html [ Failure ]
    270264storage/indexeddb/modern/index-3.html [ Failure ]
    271 storage/indexeddb/objectstore-autoincrement.html [ Failure ]
    272265
    273266# SQLite backend tests that timeout
  • trunk/Source/WebCore/ChangeLog

    r195799 r195801  
     12016-01-28  Brady Eidson  <beidson@apple.com>
     2
     3        Modern IDB: SQLite backend mismanages key generator values.
     4        https://bugs.webkit.org/show_bug.cgi?id=153625
     5
     6        Reviewed by Andy Estes.
     7
     8        No new tests (Many failing tests pass, a few get closer).
     9
     10        There's mixed assumptions about whether the value stored is the current value or the next value.
     11
     12        Fixing those assumptions fixes tests.
     13       
     14        * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
     15        (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber): Store/retrieve the correct value.
     16        (WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber): Ditto.
     17        (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber): Ditto.
     18
    1192016-01-28  Joseph Pecoraro  <pecoraro@apple.com>
    220
  • trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp

    r195787 r195801  
    13571357        return error;
    13581358
    1359     if (currentValue > maxGeneratorValue)
     1359    if (currentValue + 1 > maxGeneratorValue)
    13601360        return { IDBDatabaseException::ConstraintError, "Cannot generate new key value over 2^53 for object store operation" };
    13611361
     
    13661366IDBError SQLiteIDBBackingStore::revertGeneratedKeyNumber(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreID, uint64_t newKeyNumber)
    13671367{
    1368     LOG(IndexedDB, "SQLiteIDBBackingStore::revertGeneratedKeyNumber");
     1368    LOG(IndexedDB, "SQLiteIDBBackingStore::revertGeneratedKeyNumber - object store %" PRIu64 ", reverted number %" PRIu64, objectStoreID, newKeyNumber);
    13691369
    13701370    ASSERT(m_sqliteDB);
     
    13811381    }
    13821382
    1383     return uncheckedSetKeyGeneratorValue(objectStoreID, newKeyNumber);
     1383    ASSERT(newKeyNumber);
     1384    return uncheckedSetKeyGeneratorValue(objectStoreID, newKeyNumber - 1);
    13841385}
    13851386
     
    14151416    ASSERT(newKeyInteger > uint64_t(newKeyNumber));
    14161417
    1417     return uncheckedSetKeyGeneratorValue(objectStoreID, newKeyInteger);
     1418    return uncheckedSetKeyGeneratorValue(objectStoreID, newKeyInteger - 1);
    14181419}
    14191420
Note: See TracChangeset for help on using the changeset viewer.