1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Change the sqlite3_backup_finish() interface so that calling it with

a NULL pointer is a harmless no-op.  One other change to backup.c to facilitate
full coverage testing. (CVS 6638)

FossilOrigin-Name: 06bc89177b3af20751d9567a68551d2d31c3fe8b
This commit is contained in:
drh
2009-05-14 19:26:51 +00:00
parent 089b0a4d9c
commit dcd7db5dc9
3 changed files with 11 additions and 10 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.14 2009/05/13 07:52:06 danielk1977 Exp $
** $Id: backup.c,v 1.15 2009/05/14 19:26:51 drh Exp $
*/
#include "sqliteInt.h"
#include "btreeInt.h"
@@ -184,7 +184,7 @@ sqlite3_backup *sqlite3_backup_init(
** are considered fatal except for SQLITE_BUSY and SQLITE_LOCKED.
*/
static int isFatalError(int rc){
return (rc!=SQLITE_OK && rc!=SQLITE_BUSY && rc!=SQLITE_LOCKED);
return (rc!=SQLITE_OK && rc!=SQLITE_BUSY && ALWAYS(rc!=SQLITE_LOCKED));
}
/*
@@ -469,6 +469,7 @@ int sqlite3_backup_finish(sqlite3_backup *p){
int rc; /* Value to return */
/* Enter the mutexes */
if( p==0 ) return SQLITE_OK;
sqlite3_mutex_enter(p->pSrcDb->mutex);
sqlite3BtreeEnter(p->pSrc);
mutex = p->pSrcDb->mutex;