From dcd7db5dc923b3112b32110fb7cf62912f6ba14e Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 14 May 2009 19:26:51 +0000 Subject: [PATCH] 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 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/backup.c | 5 +++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index b5afd71bd9..f4c42bb019 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Documentation\supdates\sto\sbetter\sexplain\sthe\sSQLITE_OPEN_EXCLUSIVE\sflag.\s\sTicket\s#3855.\s(CVS\s6637) -D 2009-05-14T03:21:28 +C Change\sthe\ssqlite3_backup_finish()\sinterface\sso\sthat\scalling\sit\swith\na\sNULL\spointer\sis\sa\sharmless\sno-op.\s\sOne\sother\schange\sto\sbackup.c\sto\sfacilitate\nfull\scoverage\stesting.\s(CVS\s6638) +D 2009-05-14T19:26:51 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 583e87706abc3026960ed759aff6371faf84c211 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -103,7 +103,7 @@ F src/alter.c f0430ee68d8d80711155ddf27876abf218903b03 F src/analyze.c e239496cfb5394ac8867f1c112905ddab8d01cd9 F src/attach.c 3b99611f04926fc69c35b1145603fc3ddb0ca967 F src/auth.c 98db07c2088455797678eb1031f42d4d94d18a71 -F src/backup.c 91aaf9f065b923f33d8739f44f71ab8d9226a8d1 +F src/backup.c 437efc2c3371b52bbb943b8c9dfabba774adcf86 F src/bitvec.c ef370407e03440b0852d05024fb016b14a471d3d F src/btmutex.c 9b899c0d8df3bd68f527b0afe03088321b696d3c F src/btree.c 7c4b02afea7efb561361f20408414fec68df898c @@ -729,7 +729,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e -P 913d11149396d3dc797f1efeb4f7e60865483399 -R abb9e0125d369edd65ceec50369d192a -U shane -Z 0b4778e326f1addd073ef44654a5d985 +P 6bd44f36f46810eb9ce30c7780de6bcfe4aadf5f +R 08294acfb06e382228ced064d7f97ab0 +U drh +Z f08fef6da3e6dfcb1865b029ed85932c diff --git a/manifest.uuid b/manifest.uuid index 63b930569f..abdfea74b7 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -6bd44f36f46810eb9ce30c7780de6bcfe4aadf5f \ No newline at end of file +06bc89177b3af20751d9567a68551d2d31c3fe8b \ No newline at end of file diff --git a/src/backup.c b/src/backup.c index 09e61b6c7a..e0ab5d8822 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.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;