Diff
Modified: trunk/LayoutTests/ChangeLog (86664 => 86665)
--- trunk/LayoutTests/ChangeLog 2011-05-17 09:46:54 UTC (rev 86664)
+++ trunk/LayoutTests/ChangeLog 2011-05-17 10:12:12 UTC (rev 86665)
@@ -1,3 +1,16 @@
+2011-05-12 Hans Wennborg <[email protected]>
+
+ Reviewed by Steve Block.
+
+ IndexedDB: Index population should ignore records without key for index
+ https://bugs.webkit.org/show_bug.cgi?id=60697
+
+ Test that we can create a new index for which not all current records
+ have a key.
+
+ * storage/indexeddb/index-basics-expected.txt:
+ * storage/indexeddb/index-basics.html:
+
2011-05-17 Alexander Pavlov <[email protected]>
Reviewed by Yury Semikhatsky.
Modified: trunk/LayoutTests/storage/indexeddb/index-basics-expected.txt (86664 => 86665)
--- trunk/LayoutTests/storage/indexeddb/index-basics-expected.txt 2011-05-17 09:46:54 UTC (rev 86664)
+++ trunk/LayoutTests/storage/indexeddb/index-basics-expected.txt 2011-05-17 10:12:12 UTC (rev 86665)
@@ -27,8 +27,9 @@
PASS 'getKey' in indexObject is true
PASS 'get' in indexObject is true
store.add({x: 'value', y: 'zzz', z: 2.72}, 'key')
-event.target.source.add({x: 'value2', y: 'zzz2', z: 2.71}, 'key2')
+event.target.source.add({x: 'value2', y: 'zzz2', z: 2.71, foobar: 12}, 'key2')
store.createIndex('indexWhileAddIsInFlight', 'x')
+store.createIndex('indexWithWeirdKeyPath', 'foobar')
indexObject.getKey('value')
PASS event.target.result is "key"
indexObject2.getKey('zzz')
Modified: trunk/LayoutTests/storage/indexeddb/index-basics.html (86664 => 86665)
--- trunk/LayoutTests/storage/indexeddb/index-basics.html 2011-05-17 09:46:54 UTC (rev 86664)
+++ trunk/LayoutTests/storage/indexeddb/index-basics.html 2011-05-17 10:12:12 UTC (rev 86665)
@@ -68,10 +68,11 @@
function addMore()
{
- request = evalAndLog("event.target.source.add({x: 'value2', y: 'zzz2', z: 2.71}, 'key2')");
+ request = evalAndLog("event.target.source.add({x: 'value2', y: 'zzz2', z: 2.71, foobar: 12}, 'key2')");
request._onsuccess_ = getData;
request._onerror_ = unexpectedErrorCallback;
window.indexObject4 = evalAndLog("store.createIndex('indexWhileAddIsInFlight', 'x')");
+ window.indexObject5 = evalAndLog("store.createIndex('indexWithWeirdKeyPath', 'foobar')");
}
function getData()
Modified: trunk/Source/WebCore/ChangeLog (86664 => 86665)
--- trunk/Source/WebCore/ChangeLog 2011-05-17 09:46:54 UTC (rev 86664)
+++ trunk/Source/WebCore/ChangeLog 2011-05-17 10:12:12 UTC (rev 86665)
@@ -1,3 +1,15 @@
+2011-05-12 Hans Wennborg <[email protected]>
+
+ Reviewed by Steve Block.
+
+ IndexedDB: Index population should ignore records without key for index
+ https://bugs.webkit.org/show_bug.cgi?id=60697
+
+ When populating a new index, records which do not have a key on the
+ index's key path should be ignored.
+
+ * storage/IDBObjectStoreBackendImpl.cpp:
+
2011-05-17 Young Han Lee <[email protected]>
Reviewed by Csaba Osztrogonác.
Modified: trunk/Source/WebCore/storage/IDBObjectStoreBackendImpl.cpp (86664 => 86665)
--- trunk/Source/WebCore/storage/IDBObjectStoreBackendImpl.cpp 2011-05-17 09:46:54 UTC (rev 86664)
+++ trunk/Source/WebCore/storage/IDBObjectStoreBackendImpl.cpp 2011-05-17 10:12:12 UTC (rev 86665)
@@ -350,6 +350,8 @@
RefPtr<SerializedScriptValue> objectValue = SerializedScriptValue::createFromWire(value);
RefPtr<IDBKey> indexKey = fetchKeyFromKeyPath(objectValue.get(), m_indexKeyPath);
+ if (!indexKey)
+ return true;
if (!m_backingStore.putIndexDataForRecord(m_databaseId, m_objectStoreId, m_indexId, *indexKey, recordIdentifier))
return false;