]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Catch an obscure case of database corruption.
authordan <dan@noemail.net>
Sat, 5 Dec 2009 18:03:50 +0000 (18:03 +0000)
committerdan <dan@noemail.net>
Sat, 5 Dec 2009 18:03:50 +0000 (18:03 +0000)
FossilOrigin-Name: 0f9b17a6da42b4da667bbbc00f713effe92a66b5

manifest
manifest.uuid
src/btree.c

index 298b9feaeb9c8a40760e146384b91a904de827ff..22fd61c115b6f0f8ef7f161f0bc33a9b949684fe 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sanother\sbug\sin\s3-way\sNEAR\squeries.
-D 2009-12-05T14:29:23
+C Catch\san\sobscure\scase\sof\sdatabase\scorruption.
+D 2009-12-05T18:03:51
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in c5827ead754ab32b9585487177c93bb00b9497b3
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -108,7 +108,7 @@ F src/auth.c 523da7fb4979469955d822ff9298352d6b31de34
 F src/backup.c 744e98359dfc79fed43e8dec911e33e108b06aae
 F src/bitvec.c 06ad2c36a9c3819c0b9cbffec7b15f58d5d834e0
 F src/btmutex.c 96a12f50f7a17475155971a241d85ec5171573ff
-F src/btree.c 976b4ca0b0046bf52a8447381a136df7488f9969
+F src/btree.c bc0393e5b9e3d182706315a308f84a6a4fa388dd
 F src/btree.h 7944a9dac59eb3e541aad45fd2747f1051e7c63d
 F src/btreeInt.h 54f4245decd0409ea52cf9aee422d3d761d7ac10
 F src/build.c a48e74d24897100017d39ceba5de255e53ec9488
@@ -776,7 +776,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P 23dc6fb5b28712d1ba18dc7ddb3f2ef3b469d611
-R bd59d2e643443e6c4d242260f4459347
+P 3bb13a06521b54194c9f3eb44e0dc42bacf016a4
+R c1a926ab37f61c0c2b02b1d3be3199ea
 U dan
-Z 684064b55602f4b676c31d5b0005b496
+Z dce477f25b7ac265ef79fd810e61cc32
index 16a33ee6635f04e997d76bdebbe5b8843e764805..fcc047ec0e405be70989b8caf304882e0fb9599e 100644 (file)
@@ -1 +1 @@
-3bb13a06521b54194c9f3eb44e0dc42bacf016a4
\ No newline at end of file
+0f9b17a6da42b4da667bbbc00f713effe92a66b5
\ No newline at end of file
index 77d36f660b886fe944dfb5c8789876db0fd98a5f..17188cda0fa8ccbe119be219b714210f3c893055 100644 (file)
@@ -5593,11 +5593,16 @@ static void copyNodeContent(MemPage *pFrom, MemPage *pTo, int *pRC){
     memcpy(&aTo[iToHdr], &aFrom[iFromHdr], pFrom->cellOffset + 2*pFrom->nCell);
   
     /* Reinitialize page pTo so that the contents of the MemPage structure
-    ** match the new data. The initialization of pTo "cannot" fail, as the
-    ** data copied from pFrom is known to be valid.  */
+    ** match the new data. The initialization of pTo can actually fail under
+    ** fairly obscure circumstances, even though it is a copy of initialized 
+    ** page pFrom.
+    */
     pTo->isInit = 0;
-    TESTONLY(rc = ) btreeInitPage(pTo);
-    assert( rc==SQLITE_OK );
+    rc = btreeInitPage(pTo);
+    if( rc!=SQLITE_OK ){
+      *pRC = rc;
+      return;
+    }
   
     /* If this is an auto-vacuum database, update the pointer-map entries
     ** for any b-tree or overflow pages that pTo now contains the pointers to.