Bug 95873 - IndexedDB: Large integer versions not persisted correctly
Summary: IndexedDB: Large integer versions not persisted correctly
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: Joshua Bell
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-05 10:54 PDT by Joshua Bell
Modified: 2012-09-05 20:53 PDT (History)
4 users (show)

See Also:


Attachments
Patch (3.84 KB, patch)
2012-09-05 10:55 PDT, Joshua Bell
no flags Details | Formatted Diff | Diff
Patch (8.82 KB, patch)
2012-09-05 11:11 PDT, Joshua Bell
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Bell 2012-09-05 10:54:42 PDT
IndexedDB: Large integer versions not persisted correctly
Comment 1 Joshua Bell 2012-09-05 10:55:00 PDT
Created attachment 162287 [details]
Patch
Comment 2 Joshua Bell 2012-09-05 10:58:32 PDT
The database integer version is inconsistently stored/read as an Int vs. VarInt, which shows up when integer versions > 127 are used:

transaction->put(intVersionKey, encodeVarInt(IDBDatabaseMetadata::DefaultIntVersion));
--
ok = getInt(m_db.get(), DatabaseMetaDataKey::encode(foundId, DatabaseMetaDataKey::UserIntVersion), foundIntVersion);
--
if (!putVarInt(m_db.get(), DatabaseMetaDataKey::encode(rowId, DatabaseMetaDataKey::UserIntVersion), intVersion))
--
if (!putVarInt(m_currentTransaction.get(), DatabaseMetaDataKey::encode(rowId, DatabaseMetaDataKey::UserIntVersion), intVersion))


The getInt call needs to be a getVarInt.
Comment 3 Joshua Bell 2012-09-05 11:11:05 PDT
Created attachment 162292 [details]
Patch
Comment 4 Joshua Bell 2012-09-05 11:11:26 PDT
dgrogan@ - please take a look
Comment 5 David Grogan 2012-09-05 11:23:11 PDT
Comment on attachment 162292 [details]
Patch

LGTM
Comment 6 Joshua Bell 2012-09-05 11:24:01 PDT
Comment on attachment 162292 [details]
Patch

tony@ - r? cq?
Comment 7 WebKit Review Bot 2012-09-05 20:53:44 PDT
Comment on attachment 162292 [details]
Patch

Clearing flags on attachment: 162292

Committed r127685: <http://trac.webkit.org/changeset/127685>
Comment 8 WebKit Review Bot 2012-09-05 20:53:46 PDT
All reviewed patches have been landed.  Closing bug.