Changeset 195783 in webkit


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

Modern IDB: SQLite backend doesn't support deleting ranges with more than one key.
https://bugs.webkit.org/show_bug.cgi?id=153604

Reviewed by Andy Estes.

Source/WebCore:

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

  • Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:

(WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):

LayoutTests:

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

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r195780 r195783  
     12016-01-28  Brady Eidson  <beidson@apple.com>
     2
     3        Modern IDB: SQLite backend doesn't support deleting ranges with more than one key.
     4        https://bugs.webkit.org/show_bug.cgi?id=153604
     5
     6        Reviewed by Andy Estes.
     7
     8        * platform/mac-wk1/TestExpectations:
     9
    1102016-01-28  Carlos Alberto Lopez Perez  <clopez@igalia.com>
    211
  • trunk/LayoutTests/platform/mac-wk1/TestExpectations

    r195765 r195783  
    456456storage/indexeddb/cursor-primary-key-order.html [ Failure ]
    457457storage/indexeddb/cursor-update.html [ Failure ]
    458 storage/indexeddb/delete-range.html [ Failure ]
    459458storage/indexeddb/get-keyrange.html [ Failure ]
    460459storage/indexeddb/index-duplicate-keypaths.html [ Failure ]
     
    462461storage/indexeddb/modern/cursor-7.html [ Failure ]
    463462storage/indexeddb/modern/get-keyrange.html [ Failure ]
    464 storage/indexeddb/modern/idbobjectstore-delete-1.html [ Failure ]
    465463storage/indexeddb/modern/index-3.html [ Failure ]
    466464storage/indexeddb/mozilla/cursor-mutation.html [ Failure ]
  • trunk/Source/WebCore/ChangeLog

    r195782 r195783  
     12016-01-28  Brady Eidson  <beidson@apple.com>
     2
     3        Modern IDB: SQLite backend doesn't support deleting ranges with more than one key.
     4        https://bugs.webkit.org/show_bug.cgi?id=153604
     5
     6        Reviewed by Andy Estes.
     7
     8        No new tests (A few failing tests pass, a few get closer).
     9
     10        * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
     11        (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
     12
    1132016-01-28  Alex Christensen  <achristensen@webkit.org>
    214
  • trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp

    r195765 r195783  
    10301030    }
    10311031
    1032     // FIXME: Once cursor support is in place, use a cursor to delete every record in the range.
    1033     LOG_ERROR("Currently unable to delete all records in a multi-key range");
    1034     return { IDBDatabaseException::UnknownError, ASCIILiteral("Currently unable to delete all records in a multi-key range") };
     1032    auto cursor = transaction->maybeOpenBackingStoreCursor(objectStoreID, 0, keyRange);
     1033    if (!cursor) {
     1034        LOG_ERROR("Cannot open cursor to delete range of records from the database");
     1035        return { IDBDatabaseException::UnknownError, ASCIILiteral("Cannot open cursor to delete range of records from the database") };
     1036    }
     1037
     1038    Vector<IDBKeyData> keys;
     1039    while (!cursor->didComplete() && !cursor->didError()) {
     1040        keys.append(cursor->currentKey());
     1041        cursor->advance(1);
     1042    }
     1043
     1044    if (cursor->didError()) {
     1045        LOG_ERROR("Cursor failed while accumulating range of records from the database");
     1046        return { IDBDatabaseException::UnknownError, ASCIILiteral("Cursor failed while accumulating range of records from the database") };
     1047    }
     1048
     1049    IDBError error;
     1050    for (auto& key : keys) {
     1051        error = deleteRecord(*transaction, objectStoreID, key);
     1052        if (!error.isNull()) {
     1053            LOG_ERROR("deleteRange: Error deleting keys in range");
     1054            break;
     1055        }
     1056    }
     1057
     1058    return error;
    10351059}
    10361060
Note: See TracChangeset for help on using the changeset viewer.