1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

The sqlite3_backup_init() interface must lock the destination in case it

needs to change the error message. (CVS 6255)

FossilOrigin-Name: 572378d3a29c7d55fa4a15df14800c26d6c563a1
This commit is contained in:
drh
2009-02-04 16:56:19 +00:00
parent b48c1f192e
commit eef1eb0ff4
3 changed files with 11 additions and 9 deletions

View File

@@ -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;
}