New issue
Advanced search Search tips

Issue 765282 link

Starred by 1 user

Issue metadata

Status: Archived
Owner: ----
Closed: Jan 10
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

SQLite: MetaTable version methods don't inform callers about underlying errors

Project Member Reported by carlosk@chromium.org, Sep 14 2017

Issue description

The version related getters and setters provided by sql::MetaTable do not expose the same error detection return values as the generic ones. This poses a risk to systems relying on this class as actions might be taken based on values returned due to errors that otherwise characterize a different situation.

Example: MetaTable::SetVersionNumber fails internally when attempting to set a new value after a schema was upgraded. As this is not detected by the caller the transaction is committed. Now the database is as a different stage than its labeled version.

Working with Offline Pages we recently learned that Chrome's SQLite databases can get temporarily "unstable". If an instability moment should cause one of these calls to fail, wrong actions might be taken that might lead to data loss.
 
Suggestion: to keep the API simple (to avoid adding an extra bool everywhere) the error could be signaled to the caller as a special version value. Value "0" already means "meta table has no version information" so using "-1" for internal failures seems in order.
Status: Archived (was: Untriaged)
Archiving P3s older than 1 year with no owner or component.

Sign in to add a comment