Bug 128157 - IDB: HTML5 Rocks Indexed Database demo fails
Summary: IDB: HTML5 Rocks Indexed Database demo fails
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: All Unspecified
: P2 Normal
Assignee: Brady Eidson
Keywords: InRadar
Depends on:
Reported: 2014-02-03 21:06 PST by Brady Eidson
Modified: 2014-02-13 04:13 PST (History)
1 user (show)

See Also:

Patch v1 (1.92 KB, patch)
2014-02-03 21:08 PST, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch v2 (3.91 KB, patch)
2014-02-03 21:32 PST, Brady Eidson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.