<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>18427</bug_id>
          
          <creation_ts>2012-07-27 21:16:22 +0000</creation_ts>
          <short_desc>[IndexedDB] Spec text requires index names be unique within database</short_desc>
          <delta_ts>2013-01-31 17:47:26 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>Indexed Database API</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Joshua Bell">jsbell</reporter>
          <assigned_to name="This bug has no owner yet - up for the taking">dave.null</assigned_to>
          <cc>eliotgra</cc>
    
    <cc>mike</cc>
    
    <cc>public-webapps</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>71622</commentid>
    <comment_count>0</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2012-07-27 21:16:22 +0000</bug_when>
    <thetext>The spec sayeth:

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

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

This would appear to require that this should throw ConstraintError:

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

I don&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71786</commentid>
    <comment_count>1</comment_count>
    <who name="Eliot Graff">eliotgra</who>
    <bug_when>2012-08-02 21:35:50 +0000</bug_when>
    <thetext>I&apos;ll make the change like this:

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

deleteIndex: 
&quot;This method destroys the index with the given name in the connected object store.&quot;
&quot;There is no index with the given name, compared in a case-sensitive manner, in
the connected object store.&quot;

Thanks,

E</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71794</commentid>
    <comment_count>2</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2012-08-03 00:52:38 +0000</bug_when>
    <thetext>Looks good, although you can probably remove the word &quot;connected&quot;. I think that&apos;s there from implying the distinction between the IDBDatabase (the &quot;connection&quot;) and the database itself.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82414</commentid>
    <comment_count>3</comment_count>
    <who name="Eliot Graff">eliotgra</who>
    <bug_when>2013-01-31 17:47:26 +0000</bug_when>
    <thetext>Changes incorporated in commit #377.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>