- From: <bugzilla@jessica.w3.org>
- Date: Tue, 01 Feb 2011 17:54:29 +0000
- To: public-webapps@w3.org
http://www.w3.org/Bugs/Public/show_bug.cgi?id=11947
Summary: [IndexedDB] Updating object stores with auto increment
Product: WebAppsWG
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Indexed Database API
AssignedTo: dave.null@w3.org
ReportedBy: hans@chromium.org
QAContact: member-webapi-cvs@w3.org
CC: mike@w3.org, public-webapps@w3.org
In 5.1 Object Store Storage Operation, step 1 it says: "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's key path to the new value for key".
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: 'Abraham', number: '2107'};
store.put(abraham);
However, the way I read the specification, the key generator will
generate the key 2, and then set the "id" property in the value to 2.
So this operation does not at all overwrite the first record, and the
next statement in the example: "Now when the object store is read with
the same key, the result is different compared to the object read
earlier." 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't do anything.
2. If a user provides an in-line key, then that key takes precedence,
and the key generator doesn't do anything.
--
Configure bugmail: http://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 Tuesday, 1 February 2011 17:54:31 UTC