diff options
author | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-10 00:38:24 +0000 |
---|---|---|
committer | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-10 00:38:24 +0000 |
commit | 6d42f15f09e7ec19a1f8e3d419c9869b96d913dd (patch) | |
tree | bd69420fbb0bd9a921929e1828bfb20cee8a9faf /sql/connection.h | |
parent | 1c3988fe7e11d3d97c7a93ae00dbb022c82dbe6c (diff) | |
download | chromium_src-6d42f15f09e7ec19a1f8e3d419c9869b96d913dd.zip chromium_src-6d42f15f09e7ec19a1f8e3d419c9869b96d913dd.tar.gz chromium_src-6d42f15f09e7ec19a1f8e3d419c9869b96d913dd.tar.bz2 |
Make sql::Connection::Raze() more robust against corruptions.
Corruptions resulting from the first page showing a different database
size than the filesystem shows cause very basic functions to fail.
This does fewer queries against the corrupt database, and also enables
a magic pragma to let it make better progress.
BUG=159490
Review URL: https://chromiumcodereview.appspot.com/11369126
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167019 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sql/connection.h')
-rw-r--r-- | sql/connection.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sql/connection.h b/sql/connection.h index 319517e..8cf4d71 100644 --- a/sql/connection.h +++ b/sql/connection.h @@ -195,6 +195,19 @@ class SQL_EXPORT Connection { // Since Raze() is expected to be called in unexpected situations, // these all return false, since it is unlikely that the caller // could fix them. + // + // The database's page size is taken from |page_size_|. The + // existing database's |auto_vacuum| setting is lost (the + // possibility of corruption makes it unreliable to pull it from the + // existing database). To re-enable on the empty database requires + // running "PRAGMA auto_vacuum = 1;" then "VACUUM". + // + // NOTE(shess): For Android, SQLITE_DEFAULT_AUTOVACUUM is set to 1, + // so Raze() sets auto_vacuum to 1. + // + // TODO(shess): Raze() needs a connection so cannot clear SQLITE_NOTADB. + // TODO(shess): Bake auto_vacuum into Connection's API so it can + // just pick up the default. bool Raze(); bool RazeWithTimout(base::TimeDelta timeout); |