diff options
author | yfriedman@chromium.org <yfriedman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-06 19:22:42 +0000 |
---|---|---|
committer | yfriedman@chromium.org <yfriedman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-06 19:22:42 +0000 |
commit | 69c5845f97c6c3710aa154ae0f81dfc40c14ea66 (patch) | |
tree | 6e19280706fa03efb9bb1b76ee9f5feb1a6d1620 /sql/connection.cc | |
parent | bba7b45fd533c0a2c772593ff6943c5c87407865 (diff) | |
download | chromium_src-69c5845f97c6c3710aa154ae0f81dfc40c14ea66.zip chromium_src-69c5845f97c6c3710aa154ae0f81dfc40c14ea66.tar.gz chromium_src-69c5845f97c6c3710aa154ae0f81dfc40c14ea66.tar.bz2 |
Upstream sqlite gyp changes for Android.
Includes a change to sql/Connection to propagate the auto_vacuum pragma across a raze operation. Also updates test expectations.
BUG=137853
Review URL: https://chromiumcodereview.appspot.com/10829062
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150128 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sql/connection.cc')
-rw-r--r-- | sql/connection.cc | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/sql/connection.cc b/sql/connection.cc index c7666f9..ea3dacb 100644 --- a/sql/connection.cc +++ b/sql/connection.cc @@ -200,12 +200,27 @@ bool Connection::Raze() { // Get the page size from the current connection, then propagate it // to the null database. - Statement s(GetUniqueStatement("PRAGMA page_size")); - if (!s.Step()) - return false; - const std::string sql = StringPrintf("PRAGMA page_size=%d", s.ColumnInt(0)); - if (!null_db.Execute(sql.c_str())) - return false; + { + Statement s(GetUniqueStatement("PRAGMA page_size")); + if (!s.Step()) + return false; + const std::string sql = StringPrintf("PRAGMA page_size=%d", + s.ColumnInt(0)); + if (!null_db.Execute(sql.c_str())) + return false; + } + + // Get the value of auto_vacuum from the current connection, then propagate it + // to the null database. + { + Statement s(GetUniqueStatement("PRAGMA auto_vacuum")); + if (!s.Step()) + return false; + const std::string sql = StringPrintf("PRAGMA auto_vacuum=%d", + s.ColumnInt(0)); + if (!null_db.Execute(sql.c_str())) + return false; + } // The page size doesn't take effect until a database has pages, and // at this point the null database has none. Changing the schema |