Summary: | IndexedDB: Support auto-increment keys | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Hans Wennborg <hans> | ||||||
Component: | New Bugs | Assignee: | Hans Wennborg <hans> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | andreip, jorlow, webkit.review.bot | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Other | ||||||||
OS: | OS X 10.5 | ||||||||
Attachments: |
|
Description
Hans Wennborg
2011-01-17 07:28:21 PST
Created attachment 79175 [details]
Patch
Let's cache the last autonumber. It's even OK if we leak some numbers as long as it always increases. Also, I believe that the expected behavior is that if you have a keypath and autoIncrement value, the latter should get inserted into the former...even if it already exists. I don't remember in detail and maybe this should be brought up on list and/or changed. Also, such behavior can be punted to a later patch if non-trivial...but we should catch the error and raise an exception if so. (In reply to comment #2) > Let's cache the last autonumber. It's even OK if we leak some numbers as long as it always increases. Done. > Also, I believe that the expected behavior is that if you have a keypath and autoIncrement value, the latter should get inserted into the former...even if it already exists. I don't remember in detail and maybe this should be brought up on list and/or changed. Also, such behavior can be punted to a later patch if non-trivial...but we should catch the error and raise an exception if so. You're right, I was reading an old version of the spec. And injecting the auto incremented value into an object is non-trivial, so I'm punting on that. Re-writing the big if-else block at the start of IDBObjectStoreBackendImpl::putInternal to hopefully make it a bit clearer. Created attachment 79424 [details]
Patch
Attachment 79424 [details] did not pass style-queue: Failed to run "['Tools/Scripts/update-webkit']" exit_code: 2 perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "en_US.US-ASCII" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). Updating OpenSource perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "en_US.US-ASCII" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). RA layer request failed: OPTIONS of 'http://svn.webkit.org/repository/webkit': could not connect to server (http://svn.webkit.org) at /usr/lib/git-core/git-svn line 2295 Died at Tools/Scripts/update-webkit line 132. If any of these errors are false positives, please file a bug against check-webkit-style. Comment on attachment 79424 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=79424&action=review r=me > Source/WebCore/storage/IDBObjectStoreBackendImpl.cpp:220 > + callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Adding data to object stores with auto increment and in-line keys not currently supported.")); "Not yet supported"? Committed r76126: <http://trac.webkit.org/changeset/76126> |