Bug 65993 - IndexedDB: Overwriting key in unique index should be possible
Summary: IndexedDB: Overwriting key in unique index should be possible
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Hans Wennborg
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-10 09:52 PDT by Hans Wennborg
Modified: 2011-08-12 02:04 PDT (History)
3 users (show)

See Also:


Attachments
Patch (13.00 KB, patch)
2011-08-10 09:57 PDT, Hans Wennborg
tony: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hans Wennborg 2011-08-10 09:52:33 PDT
IndexedDB: Overwriting key in unique index should be possible
Comment 1 Hans Wennborg 2011-08-10 09:57:23 PDT
Created attachment 103499 [details]
Patch
Comment 2 WebKit Review Bot 2011-08-10 10:00:02 PDT
Attachment 103499 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/stor..." exit_code: 1

Source/WebCore/storage/IDBLevelDBBackingStore.cpp:794:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/storage/IDBSQLiteBackingStore.h:65:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/storage/IDBLevelDBBackingStore.h:70:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/storage/IDBBackingStore.h:84:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/storage/IDBSQLiteBackingStore.cpp:678:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Total errors found: 5 in 12 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Hans Wennborg 2011-08-10 10:01:20 PDT
I noticed this bug when dealing with the unique index stuff recently.

David, would you like to take a look?

I believe the style bot errors here are bogus...
Comment 4 David Grogan 2011-08-10 14:53:42 PDT
Comment on attachment 103499 [details]
Patch

LGTM
Comment 5 Hans Wennborg 2011-08-11 02:50:47 PDT
Tony, would you like to take a look?
Comment 6 Tony Chang 2011-08-11 10:24:10 PDT
Comment on attachment 103499 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=103499&action=review

> LayoutTests/storage/indexeddb/index-unique.html:141
> +    request.onsuccess = function() { done(); }

Nit: Can you just do request.onsuccess = done; ?

>> Source/WebCore/storage/IDBBackingStore.h:84

> 
> The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]

Nit: I would give the first IDBKey a name like searchKey to disambiguate it.

>> Source/WebCore/storage/IDBLevelDBBackingStore.h:70
>> +    virtual bool keyExistsInIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, RefPtr<IDBKey>& foundPrimaryKey);
> 
> The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]

Ditto.

>> Source/WebCore/storage/IDBSQLiteBackingStore.h:65
>> +    virtual bool keyExistsInIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, RefPtr<IDBKey>& foundPrimaryKey);
> 
> The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]

Ditto.
Comment 7 Hans Wennborg 2011-08-12 01:51:34 PDT
Committed r92950: <http://trac.webkit.org/changeset/92950>
Comment 8 Hans Wennborg 2011-08-12 02:04:46 PDT
(In reply to comment #6)
> (From update of attachment 103499 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=103499&action=review

Thanks Tony!

> 
> > LayoutTests/storage/indexeddb/index-unique.html:141
> > +    request.onsuccess = function() { done(); }
> 
> Nit: Can you just do request.onsuccess = done; ?
Done.

> 
> >> Source/WebCore/storage/IDBBackingStore.h:84
> 
> > 
> > The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
> 
> Nit: I would give the first IDBKey a name like searchKey to disambiguate it.
Done.

> 
> >> Source/WebCore/storage/IDBLevelDBBackingStore.h:70
> >> +    virtual bool keyExistsInIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, RefPtr<IDBKey>& foundPrimaryKey);
> > 
> > The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
> 
> Ditto.
Done.

> 
> >> Source/WebCore/storage/IDBSQLiteBackingStore.h:65
> >> +    virtual bool keyExistsInIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, RefPtr<IDBKey>& foundPrimaryKey);
> > 
> > The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
> 
> Ditto.
Done.