This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 11094 - [IndexedDB] IDBIndex.get* don't define which item is returned in the case of duplicates
Summary: [IndexedDB] IDBIndex.get* don't define which item is returned in the case of ...
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: Indexed Database API (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Jonas Sicking (Not reading bugmail)
QA Contact: public-webapps-bugzilla
Depends on:
Reported: 2010-10-19 13:47 UTC by Jeremy Orlow
Modified: 2010-11-08 11:34 UTC (History)
3 users (show)

See Also:


Description Jeremy Orlow 2010-10-19 13:47:36 UTC
It's possible for indexes to be non-unique in which case IDBIndex.get* may lookup one of several entries. We should specify which is returned in a deterministic way. It should probably be connected to the order in which cursors return duplicates as well.
Comment 1 Jonas Sicking (Not reading bugmail) 2010-10-19 23:47:31 UTC
I recall discussing this on the list.

Like you point out, the same issue exists when using a cursor created using IDBIndex.createObjectCursor. Here we need to define which order duplicates are iterated in.

IMO the order should be the key order in the objectStore. I.e. items in indexes are first ordered by their keyPath value, then by the objectStores key value.

get* functions should return the first item according to this order.
Comment 2 Jonas Sicking (Not reading bugmail) 2010-11-01 04:53:16 UTC
Working at rewriting cursor handling, especially related to indexes.
Comment 3 Jonas Sicking (Not reading bugmail) 2010-11-08 11:34:57 UTC
Should be fixed by

Would be great if someone could check that it looks correct.