Modern IDB: Getting records for key ranges with null keys aren't properly handled...
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jan 2016 23:23:17 +0000 (23:23 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jan 2016 23:23:17 +0000 (23:23 +0000)
https://bugs.webkit.org/show_bug.cgi?id=153666

Reviewed by Tim Horton.

Source/WebCore:

No new tests (Two failing tests now pass).

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):

LayoutTests:

* platform/mac-wk1/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@195850 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/mac-wk1/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp

index 384bc04..5ca09e0 100644 (file)
@@ -1,3 +1,12 @@
+2016-01-29  Brady Eidson  <beidson@apple.com>
+
+        Modern IDB: Getting records for key ranges with null keys aren't properly handled in SQLite backend
+        https://bugs.webkit.org/show_bug.cgi?id=153666
+
+        Reviewed by Tim Horton.
+
+        * platform/mac-wk1/TestExpectations:
+
 2016-01-29  Simon Fraser  <simon.fraser@apple.com>
 
         image-rendering: -webkit-optimize-contrast not working for background images
index 66ad4d1..642cb2e 100644 (file)
@@ -257,8 +257,6 @@ inspector/script-profiler/event-type-API.html
 imported/w3c/indexeddb/idbindex-multientry-big.htm [ Failure ]
 storage/indexeddb/cursor-continue-validity.html [ Failure ]
 storage/indexeddb/cursor-primary-key-order.html [ Failure ]
-storage/indexeddb/get-keyrange.html [ Failure ]
-storage/indexeddb/modern/get-keyrange.html [ Failure ]
 
 # SQLite backend tests that timeout
 storage/indexeddb/modern/transaction-scheduler-1.html [ Skip ]
index 02338b5..f44fb83 100644 (file)
@@ -1,3 +1,15 @@
+2016-01-29  Brady Eidson  <beidson@apple.com>
+
+        Modern IDB: Getting records for key ranges with null keys aren't properly handled in SQLite backend
+        https://bugs.webkit.org/show_bug.cgi?id=153666
+
+        Reviewed by Tim Horton.
+
+        No new tests (Two failing tests now pass).
+
+        * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
+        (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
+
 2016-01-29  Simon Fraser  <simon.fraser@apple.com>
 
         image-rendering: -webkit-optimize-contrast not working for background images
index 70a71ee..4a1bd76 100644 (file)
@@ -1196,13 +1196,19 @@ IDBError SQLiteIDBBackingStore::getRecord(const IDBResourceIdentifier& transacti
         return { IDBDatabaseException::UnknownError, ASCIILiteral("Attempt to get a record from database without an in-progress transaction") };
     }
 
-    RefPtr<SharedBuffer> lowerBuffer = serializeIDBKeyData(IDBKeyData(keyRange.lowerKey));
+    auto key = keyRange.lowerKey;
+    if (key.isNull())
+        key = IDBKeyData::minimum();
+    RefPtr<SharedBuffer> lowerBuffer = serializeIDBKeyData(key);
     if (!lowerBuffer) {
         LOG_ERROR("Unable to serialize lower IDBKey in lookup range");
         return { IDBDatabaseException::UnknownError, ASCIILiteral("Unable to serialize lower IDBKey in lookup range") };
     }
 
-    RefPtr<SharedBuffer> upperBuffer = serializeIDBKeyData(IDBKeyData(keyRange.upperKey));
+    key = keyRange.upperKey;
+    if (key.isNull())
+        key = IDBKeyData::maximum();
+    RefPtr<SharedBuffer> upperBuffer = serializeIDBKeyData(key);
     if (!upperBuffer) {
         LOG_ERROR("Unable to serialize upper IDBKey in lookup range");
         return { IDBDatabaseException::UnknownError, ASCIILiteral("Unable to serialize upper IDBKey in lookup range") };