Bug 95873

Summary: IndexedDB: Large integer versions not persisted correctly
Product: WebKit Reporter: Joshua Bell <jsbell>
Component: New BugsAssignee: Joshua Bell <jsbell>
Status: RESOLVED FIXED    
Severity: Normal CC: alecflett, dgrogan, tony, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

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.