summaryrefslogtreecommitdiff
path: root/ext/pdo_sqlite/sqlite/src/vacuum.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2005-06-30 20:58:36 +0000
committerIlia Alshanetsky <iliaa@php.net>2005-06-30 20:58:36 +0000
commit7d02c9dcb2e9e06aef2e74068abedb929198c4c5 (patch)
treed4aa4b9ee9c45ef44c51d06710917b81fc022667 /ext/pdo_sqlite/sqlite/src/vacuum.c
parentefc6ccaa01caba362c59e1708261076e25a28efe (diff)
downloadphp-git-7d02c9dcb2e9e06aef2e74068abedb929198c4c5.tar.gz
Upgraded bundled sqlite lib to 3.2.2
Diffstat (limited to 'ext/pdo_sqlite/sqlite/src/vacuum.c')
-rw-r--r--ext/pdo_sqlite/sqlite/src/vacuum.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/pdo_sqlite/sqlite/src/vacuum.c b/ext/pdo_sqlite/sqlite/src/vacuum.c
index ed418b0ff6..8254528d9d 100644
--- a/ext/pdo_sqlite/sqlite/src/vacuum.c
+++ b/ext/pdo_sqlite/sqlite/src/vacuum.c
@@ -100,6 +100,11 @@ int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){
Btree *pMain; /* The database being vacuumed */
Btree *pTemp;
char *zSql = 0;
+ int writeschema_flag; /* Saved value of the write-schema flag */
+
+ /* Save the current value of the write-schema flag before setting it. */
+ writeschema_flag = db->flags&SQLITE_WriteSchema;
+ db->flags |= SQLITE_WriteSchema;
if( !db->autoCommit ){
sqlite3SetString(pzErrMsg, "cannot VACUUM from within a transaction",
@@ -276,6 +281,10 @@ int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){
}
end_of_vacuum:
+ /* Restore the original value of the write-schema flag. */
+ db->flags &= ~SQLITE_WriteSchema;
+ db->flags |= writeschema_flag;
+
/* Currently there is an SQL level transaction open on the vacuum
** database. No locks are held on any other files (since the main file
** was committed at the btree level). So it safe to end the transaction
@@ -296,5 +305,6 @@ end_of_vacuum:
if( zSql ) sqliteFree( zSql );
sqlite3ResetInternalSchema(db, 0);
#endif
+
return rc;
}