]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix the backup logic so that it detects a failure to sqlite3BtreeUpdateMeta()
authordrh <drh@noemail.net>
Mon, 6 Jul 2009 19:03:12 +0000 (19:03 +0000)
committerdrh <drh@noemail.net>
Mon, 6 Jul 2009 19:03:12 +0000 (19:03 +0000)
and reports that failure back up to the top level. (CVS 6851)

FossilOrigin-Name: 471b92f2514aedecb5773825a7ae472190375727

manifest
manifest.uuid
src/backup.c

index aeacc8db81a6047ef09569f75a811a64800b73d7..22a2fc0c39a25071a8144f4f1c47333c694370e5 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Make\sthe\ssqlite3BtreeMoveto\sfunction\sstatic,\ssince\sit\sis\sonly\sused\sfrom\swithin\sbtree.c.\sRemove\sunused\sfunction\slockBtreeWithRetry\sfrom\sbtree.c.\s(CVS\s6850)
-D 2009-07-06T18:56:13
+C Fix\sthe\sbackup\slogic\sso\sthat\sit\sdetects\sa\sfailure\sto\ssqlite3BtreeUpdateMeta()\nand\sreports\sthat\sfailure\sback\sup\sto\sthe\stop\slevel.\s(CVS\s6851)
+D 2009-07-06T19:03:13
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in df9359da7a726ccb67a45db905c5447d5c00c6ef
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -103,7 +103,7 @@ F src/alter.c 95f41d957f56407aac6224041ca5b954042318d1
 F src/analyze.c e239496cfb5394ac8867f1c112905ddab8d01cd9
 F src/attach.c 13995348fc5a26cdd136a50806faf292aabc173f
 F src/auth.c 802a9439dfa0b8c208b10055cba400e82ef18025
-F src/backup.c 97a3859d8585eb4fcb1e81a795cf4b3fdd82f30f
+F src/backup.c 6f1c2d9862c8a3feb7739dfcca02c1f5352e37f3
 F src/bitvec.c 0ef0651714728055d43de7a4cdd95e703fac0119
 F src/btmutex.c 9b899c0d8df3bd68f527b0afe03088321b696d3c
 F src/btree.c 1a7caa2b0dfd76a7e28049e2333997e6f317c9f3
@@ -740,7 +740,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746
-P 1636e7831a21d401a48aa74d884444a287f14f72
-R 7e38f383918ece6e29e3d7609123e090
-U danielk1977
-Z e5cf1d022d5f233619186bb620497925
+P 30d5ec62ab6a85ee60ee4128e20959842f8c7ad1
+R f51708f39711f3df96d46a6137854687
+U drh
+Z adb1cb8068914d918224f5f7ac9e9136
index d464ae17e5d27ae642103fab5f61c5132f367503..edb763829db5bd9be61e1fa1b1e27e9707113727 100644 (file)
@@ -1 +1 @@
-30d5ec62ab6a85ee60ee4128e20959842f8c7ad1
\ No newline at end of file
+471b92f2514aedecb5773825a7ae472190375727
\ No newline at end of file
index a0daa632137149d383db2eefa9a0091191e7f9a1..1e5f108540a328fa8a1b09bb9b002b9772646ff6 100644 (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.18 2009/07/02 07:47:33 danielk1977 Exp $
+** $Id: backup.c,v 1.19 2009/07/06 19:03:13 drh Exp $
 */
 #include "sqliteInt.h"
 #include "btreeInt.h"
@@ -358,17 +358,18 @@ int sqlite3_backup_step(sqlite3_backup *p, int nPage){
       }
     }
   
-    if( rc==SQLITE_DONE ){
+    /* Update the schema version field in the destination database. This
+    ** is to make sure that the schema-version really does change in
+    ** the case where the source and destination databases have the
+    ** same schema version.
+    */
+    if( rc==SQLITE_DONE 
+     && (rc = sqlite3BtreeUpdateMeta(p->pDest,1,p->iDestSchema+1))==SQLITE_OK
+    ){
       const int nSrcPagesize = sqlite3BtreeGetPageSize(p->pSrc);
       const int nDestPagesize = sqlite3BtreeGetPageSize(p->pDest);
       int nDestTruncate;
   
-      /* Update the schema version field in the destination database. This
-      ** is to make sure that the schema-version really does change in
-      ** the case where the source and destination databases have the
-      ** same schema version.
-      */
-      sqlite3BtreeUpdateMeta(p->pDest, 1, p->iDestSchema+1);
       if( p->pDestDb ){
         sqlite3ResetInternalSchema(p->pDestDb, 0);
       }