summaryrefslogtreecommitdiffstats
path: root/lib/libsqlite3/src/backup.c
diff options
context:
space:
mode:
authorjturner <jturner@openbsd.org>2014-03-24 01:37:28 +0000
committerjturner <jturner@openbsd.org>2014-03-24 01:37:28 +0000
commit29ebcee2452a131560f5220abaf585648f84ce40 (patch)
tree844ef4fe135beff619b9e7b632f3b6722d6367e4 /lib/libsqlite3/src/backup.c
parentannotate some packed structures with the alignment the hardware (diff)
downloadwireguard-openbsd-29ebcee2452a131560f5220abaf585648f84ce40.tar.xz
wireguard-openbsd-29ebcee2452a131560f5220abaf585648f84ce40.zip
Update sqlite to 3.8.4. A list of changes are available here:
http://sqlite.org/changes.html. Tested in a bulk and ok landry@
Diffstat (limited to 'lib/libsqlite3/src/backup.c')
-rw-r--r--lib/libsqlite3/src/backup.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libsqlite3/src/backup.c b/lib/libsqlite3/src/backup.c
index afbaeeb1097..4a6bc7493c4 100644
--- a/lib/libsqlite3/src/backup.c
+++ b/lib/libsqlite3/src/backup.c
@@ -96,6 +96,7 @@ static Btree *findBtree(sqlite3 *pErrorDb, sqlite3 *pDb, const char *zDb){
rc = SQLITE_ERROR;
}
sqlite3DbFree(pErrorDb, pParse->zErrMsg);
+ sqlite3ParserReset(pParse);
sqlite3StackFree(pErrorDb, pParse);
}
if( rc ){
@@ -525,7 +526,7 @@ int sqlite3_backup_step(sqlite3_backup *p, int nPage){
/* Sync the database file to disk. */
if( rc==SQLITE_OK ){
- rc = sqlite3PagerSync(pDestPager);
+ rc = sqlite3PagerSync(pDestPager, 0);
}
}else{
sqlite3PagerTruncateImage(pDestPager, nDestTruncate);
@@ -600,10 +601,10 @@ int sqlite3_backup_finish(sqlite3_backup *p){
/* Set the error code of the destination database handle. */
rc = (p->rc==SQLITE_DONE) ? SQLITE_OK : p->rc;
- sqlite3Error(p->pDestDb, rc, 0);
-
- /* Exit the mutexes and free the backup context structure. */
if( p->pDestDb ){
+ sqlite3Error(p->pDestDb, rc, 0);
+
+ /* Exit the mutexes and free the backup context structure. */
sqlite3LeaveMutexAndCloseZombie(p->pDestDb);
}
sqlite3BtreeLeave(p->pSrc);