<?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>11947</bug_id>
          
          <creation_ts>2011-02-01 17:54:29 +0000</creation_ts>
          <short_desc>[IndexedDB] Updating object stores with auto increment</short_desc>
          <delta_ts>2011-02-04 10:33:39 +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>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>11976</dup_id>
          
          <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="Hans Wennborg">hans</reporter>
          <assigned_to name="This bug has no owner yet - up for the taking">dave.null</assigned_to>
          <cc>jorlow</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>44978</commentid>
    <comment_count>0</comment_count>
    <who name="Hans Wennborg">hans</who>
    <bug_when>2011-02-01 17:54:29 +0000</bug_when>
    <thetext>In 5.1 Object Store Storage Operation, step 1 it says: &quot;If store uses
a key generator and key is undefined, set key to the next generated
key. If store also uses in-line keys, then set the property in value
pointed to by store&apos;s key path to the new value for key&quot;.

But in the object store example in 3.3.3, there is the following:

A second put operation will overwrite the record stored by the first
put operation.
var abraham = {id: 1, name: &apos;Abraham&apos;, number: &apos;2107&apos;};
store.put(abraham);

However, the way I read the specification, the key generator will
generate the key 2, and then set the &quot;id&quot; property in the value to 2.
So this operation does not at all overwrite the first record, and the
next statement in the example: &quot;Now when the object store is read with
the same key, the result is different compared to the object read
earlier.&quot; is false.

To me, it would make sense that:

1. If a user provides an explicit key to an operation on an object
store that has a key generator, then the explicit key takes
precedence, and the key generator doesn&apos;t do anything.

2. If a user provides an in-line key, then that key takes precedence,
and the key generator doesn&apos;t do anything.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45121</commentid>
    <comment_count>1</comment_count>
    <who name="Hans Wennborg">hans</who>
    <bug_when>2011-02-04 10:33:39 +0000</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 11976 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>