[Bug 18427] New: [IndexedDB] Spec text requires index names be unique within database

https://www.w3.org/Bugs/Public/show_bug.cgi?id=18427

           Summary: [IndexedDB] Spec text requires index names be unique
                    within database
           Product: WebAppsWG
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Indexed Database API
        AssignedTo: dave.null@w3.org
        ReportedBy: jsbell@chromium.org
         QAContact: public-webapps-bugzilla@w3.org
                CC: mike@w3.org, public-webapps@w3.org


The spec sayeth:

createIndex: 
"If an index with the same name already exists, the implementation must throw a
DOMException of type ConstraintError."
"An index with the same name, compared in a case-sensitive manner, already
exists in the connected database."

deleteIndex: 
"This method destroys the index with the given name in the connected database."
"There is no index with the given name, compared in a case-sensitive manner, in
the connected database."

This would appear to require that this should throw ConstraintError:

mozIndexedDB.open("my-db", 1).onupgradeneeded = function(e) {
  db = e.target.result;
  s1 = db.createObjectStore('s1');
  s2 = db.createObjectStore('s2');
  s1.createIndex('i', 'keypath');
  s2.createIndex('i', 'keypath');
};

I don't believe this is the intention of the spec, and neither Firefox (14) nor
Chrome (20) behave this way. The uniqueness constraint for index names should
be just is within an object store, not across the database. It looks like this
is just a copy/pasta from the description/exception tables for
create/deleteObjectStore.

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

Received on Friday, 27 July 2012 21:16:23 UTC