diff options
author | drh <drh@noemail.net> | 2009-02-04 16:56:19 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2009-02-04 16:56:19 +0000 |
commit | eef1eb0ff45b8a5754a29b261b615dac46aef3d3 (patch) | |
tree | 1b181d29eb22174f13cde597afc2816e65b388c5 /src/backup.c | |
parent | b48c1f192e14e3cf20f366f52575eec456dadfb4 (diff) | |
download | sqlite-eef1eb0ff45b8a5754a29b261b615dac46aef3d3.tar.gz sqlite-eef1eb0ff45b8a5754a29b261b615dac46aef3d3.zip |
The sqlite3_backup_init() interface must lock the destination in case it
needs to change the error message. (CVS 6255)
FossilOrigin-Name: 572378d3a29c7d55fa4a15df14800c26d6c563a1
Diffstat (limited to 'src/backup.c')
-rw-r--r-- | src/backup.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backup.c b/src/backup.c index 8d77fded6..d3ffae188 100644 --- a/src/backup.c +++ b/src/backup.c @@ -12,7 +12,7 @@ ** This file contains the implementation of the sqlite3_backup_XXX() ** API functions and the related features. ** -** $Id: backup.c,v 1.5 2009/02/04 01:49:30 shane Exp $ +** $Id: backup.c,v 1.6 2009/02/04 16:56:19 drh Exp $ */ #include "sqliteInt.h" #include "btreeInt.h" @@ -134,6 +134,7 @@ sqlite3_backup *sqlite3_backup_init( ** a malfunction or a deadlock. */ sqlite3_mutex_enter(pSrcDb->mutex); + sqlite3_mutex_enter(pDestDb->mutex); if( pSrcDb==pDestDb ){ sqlite3Error( @@ -181,6 +182,7 @@ sqlite3_backup *sqlite3_backup_init( p->pSrc->nBackup++; } + sqlite3_mutex_leave(pDestDb->mutex); sqlite3_mutex_leave(pSrcDb->mutex); return p; } |