Title: [195850] trunk
Revision
195850
Author
[email protected]
Date
2016-01-29 15:23:17 -0800 (Fri, 29 Jan 2016)

Log Message

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.

Source/WebCore:

No new tests (Two failing tests now pass).

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

LayoutTests:

* platform/mac-wk1/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (195849 => 195850)


--- trunk/LayoutTests/ChangeLog	2016-01-29 23:18:49 UTC (rev 195849)
+++ trunk/LayoutTests/ChangeLog	2016-01-29 23:23:17 UTC (rev 195850)
@@ -1,3 +1,12 @@
+2016-01-29  Brady Eidson  <[email protected]>
+
+        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  <[email protected]>
 
         image-rendering: -webkit-optimize-contrast not working for background images

Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (195849 => 195850)


--- trunk/LayoutTests/platform/mac-wk1/TestExpectations	2016-01-29 23:18:49 UTC (rev 195849)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations	2016-01-29 23:23:17 UTC (rev 195850)
@@ -257,8 +257,6 @@
 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 ]

Modified: trunk/Source/WebCore/ChangeLog (195849 => 195850)


--- trunk/Source/WebCore/ChangeLog	2016-01-29 23:18:49 UTC (rev 195849)
+++ trunk/Source/WebCore/ChangeLog	2016-01-29 23:23:17 UTC (rev 195850)
@@ -1,3 +1,15 @@
+2016-01-29  Brady Eidson  <[email protected]>
+
+        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  <[email protected]>
 
         image-rendering: -webkit-optimize-contrast not working for background images

Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp (195849 => 195850)


--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp	2016-01-29 23:18:49 UTC (rev 195849)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp	2016-01-29 23:23:17 UTC (rev 195850)
@@ -1196,13 +1196,19 @@
         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") };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to