Changeset 86665 in webkit


Ignore:
Timestamp:
May 17, 2011, 3:12:12 AM (14 years ago)
Author:
hans@chromium.org
Message:

2011-05-12 Hans Wennborg <hans@chromium.org>

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-12 Hans Wennborg <hans@chromium.org>

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:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r86663 r86665  
     12011-05-12  Hans Wennborg  <hans@chromium.org>
     2
     3        Reviewed by Steve Block.
     4
     5        IndexedDB: Index population should ignore records without key for index
     6        https://bugs.webkit.org/show_bug.cgi?id=60697
     7
     8        Test that we can create a new index for which not all current records
     9        have a key.
     10
     11        * storage/indexeddb/index-basics-expected.txt:
     12        * storage/indexeddb/index-basics.html:
     13
    1142011-05-17  Alexander Pavlov  <apavlov@chromium.org>
    215
  • trunk/LayoutTests/storage/indexeddb/index-basics-expected.txt

    r80471 r86665  
    2828PASS 'get' in indexObject is true
    2929store.add({x: 'value', y: 'zzz', z: 2.72}, 'key')
    30 event.target.source.add({x: 'value2', y: 'zzz2', z: 2.71}, 'key2')
     30event.target.source.add({x: 'value2', y: 'zzz2', z: 2.71, foobar: 12}, 'key2')
    3131store.createIndex('indexWhileAddIsInFlight', 'x')
     32store.createIndex('indexWithWeirdKeyPath', 'foobar')
    3233indexObject.getKey('value')
    3334PASS event.target.result is "key"
  • trunk/LayoutTests/storage/indexeddb/index-basics.html

    r80471 r86665  
    6969function addMore()
    7070{
    71     request = evalAndLog("event.target.source.add({x: 'value2', y: 'zzz2', z: 2.71}, 'key2')");
     71    request = evalAndLog("event.target.source.add({x: 'value2', y: 'zzz2', z: 2.71, foobar: 12}, 'key2')");
    7272    request.onsuccess = getData;
    7373    request.onerror = unexpectedErrorCallback;
    7474    window.indexObject4 = evalAndLog("store.createIndex('indexWhileAddIsInFlight', 'x')");
     75    window.indexObject5 = evalAndLog("store.createIndex('indexWithWeirdKeyPath', 'foobar')");
    7576}
    7677
  • trunk/Source/WebCore/ChangeLog

    r86664 r86665  
     12011-05-12  Hans Wennborg  <hans@chromium.org>
     2
     3        Reviewed by Steve Block.
     4
     5        IndexedDB: Index population should ignore records without key for index
     6        https://bugs.webkit.org/show_bug.cgi?id=60697
     7
     8        When populating a new index, records which do not have a key on the
     9        index's key path should be ignored.
     10
     11        * storage/IDBObjectStoreBackendImpl.cpp:
     12
    1132011-05-17  Young Han Lee  <joybro@company100.net>
    214
  • trunk/Source/WebCore/storage/IDBObjectStoreBackendImpl.cpp

    r85238 r86665  
    351351        RefPtr<IDBKey> indexKey = fetchKeyFromKeyPath(objectValue.get(), m_indexKeyPath);
    352352
     353        if (!indexKey)
     354            return true;
    353355        if (!m_backingStore.putIndexDataForRecord(m_databaseId, m_objectStoreId, m_indexId, *indexKey, recordIdentifier))
    354356            return false;
Note: See TracChangeset for help on using the changeset viewer.