Bug 128157

Summary: IDB: HTML5 Rocks Indexed Database demo fails
Product: WebKit Reporter: Brady Eidson <beidson>
Component: WebKit2Assignee: Brady Eidson <beidson>
Status: ASSIGNED ---    
Severity: Normal CC: jonlee
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: Unspecified   
Attachments:
Description Flags
Patch v1
none
Patch v2 none

Description Brady Eidson 2014-02-03 21:06:02 PST
IDB: HTML5 Rocks Indexed Database demo fails

The demo can be found here - http://www.html5rocks.com/en/tutorials/indexeddb/todo/

TODOs that you save are stored to the database, but they are never retrieved.

This is because the value cursor they create never returns any values.

And that is because we're choosing the wrong SQL statement for the cursor.

In radar as <rdar://problem/15966095>
Comment 1 Brady Eidson 2014-02-03 21:08:39 PST
Created attachment 223068 [details]
Patch v1
Comment 2 Brady Eidson 2014-02-03 21:08:58 PST
Of the large number of layout test failures, this fixes a handful!  \o/
Comment 3 Jon Lee 2014-02-03 21:27:09 PST
Comment on attachment 223068 [details]
Patch v1

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

> Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:112
> +

This is all fine except the statements are not in consistent order. Line 77-78 is open upper key, not closed upper key like in 85-86 and 92-93.

> Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:164
> +

This looks good here.

It might be slightly better to name the variables "hasLowerKey", "isLowerOpen", "hasUpperKey", "isUpperOpen", even though the current var names are more consistent with the IDB API.
Comment 4 Jon Lee 2014-02-03 21:27:45 PST
provisional r-!
Comment 5 Brady Eidson 2014-02-03 21:32:32 PST
Created attachment 223071 [details]
Patch v2
Comment 6 Brady Eidson 2014-02-03 21:33:09 PST
Nice find, and good suggestion.  New patch uploaded.
Comment 7 Jon Lee 2014-02-03 21:34:03 PST
Comment on attachment 223071 [details]
Patch v2

Provisional r=me!
Comment 8 Brady Eidson 2014-02-03 21:34:33 PST
Thanks for the eyes!
Comment 9 Brady Eidson 2014-02-03 21:39:44 PST
http://trac.webkit.org/changeset/163364 and http://trac.webkit.org/changeset/163365 as a build fix followup
Comment 10 Csaba Osztrogonác 2014-02-13 04:13:12 PST
Comment on attachment 223068 [details]
Patch v1

Cleared Anders Carlsson's review+ from obsolete attachment 223068 [details] so that this bug does not appear in http://webkit.org/pending-commit.