Modified: trunk/Source/WebKit2/ChangeLog (163363 => 163364)
--- trunk/Source/WebKit2/ChangeLog 2014-02-04 05:10:04 UTC (rev 163363)
+++ trunk/Source/WebKit2/ChangeLog 2014-02-04 05:42:05 UTC (rev 163364)
@@ -1,3 +1,15 @@
+2014-02-03 Brady Eidson <beid...@apple.com>
+
+ IDB: HTML5 Rocks Indexed Database demo fails
+ https://bugs.webkit.org/show_bug.cgi?id=128157
+
+ Reviewed by Anders Carlsson (Provisional review by Jon Lee)
+
+ * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:
+ (WebKit::getIndexStatement): Only increment the open/closed counters if those keys exist.
+ Fix order of statements for no lower key.
+ (WebKit::getObjectStoreStatement): Only increment the open/closed counters if those keys exist.
+
2014-02-03 Jae Hyun Park <jae.p...@company100.net>
Use nullptr in ShareableBitmap
Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp (163363 => 163364)
--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp 2014-02-04 05:10:04 UTC (rev 163363)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp 2014-02-04 05:42:05 UTC (rev 163364)
@@ -64,7 +64,7 @@
ASSERT(m_objectStoreID);
}
-static const String& getIndexStatement(bool lowerKey, bool lowerOpen, bool upperKey, bool upperOpen, bool descending)
+static const String& getIndexStatement(bool hasLowerKey, bool isLowerOpen, bool hasUpperKey, bool isUpperOpen, bool descending)
{
DEFINE_STATIC_LOCAL(Vector<String>, indexStatements, ());
@@ -74,10 +74,10 @@
// No lower key statements (6)
indexStatements.append(ASCIILiteral("SELECT key, value FROM IndexRecords WHERE indexID = ? ORDER BY key;"));
indexStatements.append(ASCIILiteral("SELECT key, value FROM IndexRecords WHERE indexID = ? ORDER BY key DESC;"));
+ indexStatements.append(ASCIILiteral("SELECT key, value FROM IndexRecords WHERE indexID = ? AND key <= CAST(? AS TEXT) ORDER BY key;"));
+ indexStatements.append(ASCIILiteral("SELECT key, value FROM IndexRecords WHERE indexID = ? AND key <= CAST(? AS TEXT) ORDER BY key DESC;"));
indexStatements.append(ASCIILiteral("SELECT key, value FROM IndexRecords WHERE indexID = ? AND key < CAST(? AS TEXT) ORDER BY key;"));
indexStatements.append(ASCIILiteral("SELECT key, value FROM IndexRecords WHERE indexID = ? AND key < CAST(? AS TEXT) ORDER BY key DESC;"));
- indexStatements.append(ASCIILiteral("SELECT key, value FROM IndexRecords WHERE indexID = ? AND key <= CAST(? AS TEXT) ORDER BY key;"));
- indexStatements.append(ASCIILiteral("SELECT key, value FROM IndexRecords WHERE indexID = ? AND key <= CAST(? AS TEXT) ORDER BY key DESC;"));
// Closed lower key statements (6)
indexStatements.append(ASCIILiteral("SELECT key, value FROM IndexRecords WHERE indexID = ? AND key >= CAST(? AS TEXT) ORDER BY key;"));
@@ -97,14 +97,19 @@
}
size_t i = 0;
- if (lowerKey)
+
+ if (hasLowerKey) {
i += 6;
- if (lowerOpen)
- i += 6;
- if (upperKey)
+ if (isLowerOpen)
+ i += 6;
+ }
+
+ if (hasUpperKey) {
i += 2;
- if (upperOpen)
- i += 2;
+ if (isUpperOpen)
+ i += 2;
+ }
+
if (descending)
i += 1;
@@ -144,14 +149,19 @@
}
size_t i = 0;
- if (lowerKey)
+
+ if (hasLowerKey) {
i += 6;
- if (lowerOpen)
- i += 6;
- if (upperKey)
+ if (isLowerOpen)
+ i += 6;
+ }
+
+ if (hasUpperKey) {
i += 2;
- if (upperOpen)
- i += 2;
+ if (isUpperOpen)
+ i += 2;
+ }
+
if (descending)
i += 1;