]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Modify the integrity-check code so that each b-tree page inspected is reinitialized...
authordanielk1977 <danielk1977@noemail.net>
Sat, 11 Jul 2009 06:55:33 +0000 (06:55 +0000)
committerdanielk1977 <danielk1977@noemail.net>
Sat, 11 Jul 2009 06:55:33 +0000 (06:55 +0000)
FossilOrigin-Name: 709576c670f802bf4b6e5c0e8db2bbde2cc16a90

manifest
manifest.uuid
src/btree.c
test/corruptC.test

index 6768c53bd85e66c7ad5dce7684d85db06e98d2f7..706b77fe328d46791d7e2670123e28ab37e00762 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Remove\sunreachable\scondition\sfrom\sbtree.c.\s(CVS\s6876)
-D 2009-07-11T05:06:52
+C Modify\sthe\sintegrity-check\scode\sso\sthat\seach\sb-tree\spage\sinspected\sis\sreinitialized\swhile\sdoing\sso,\seven\sif\san\sinitialized\scopy\sexists\sin\sthe\scache.\sThis\sprevents\san\sassert\sfrom\sfailing\swhen\srunning\sintegrity_check\son\sa\scorrupt\sdatabase.\s(CVS\s6877)
+D 2009-07-11T06:55:34
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in df9359da7a726ccb67a45db905c5447d5c00c6ef
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -106,7 +106,7 @@ F src/auth.c 802a9439dfa0b8c208b10055cba400e82ef18025
 F src/backup.c 6f1c2d9862c8a3feb7739dfcca02c1f5352e37f3
 F src/bitvec.c 0ef0651714728055d43de7a4cdd95e703fac0119
 F src/btmutex.c 9b899c0d8df3bd68f527b0afe03088321b696d3c
-F src/btree.c 563cda7bbb92ff33c0e5b2fda589e6b59f89d5ed
+F src/btree.c 829ff60149485219f4933ad63fb37705da4a3968
 F src/btree.h e53a10fd31d16c60a86f03c9467a6f470aa3683b
 F src/btreeInt.h a568bf057aa249eb06fd31358b4393a5ac88c118
 F src/build.c 867028ee9f63f7bc8eb8d4a720bb98cf9b9a12b4
@@ -291,7 +291,7 @@ F test/corrupt8.test 9992ef7f67cefc576b92373f6bf5ab8775280f51
 F test/corrupt9.test 4aa1cb1ef091cb0e13e89a819c72911631b5176a
 F test/corruptA.test 99e95620b980161cb3e79f06a884a4bb8ae265ff
 F test/corruptB.test 267be7fbb7bdb89df40007178437ebdd0cd9c174
-F test/corruptC.test 4ee86485de5263ed050729c11650dd59ca288bd3
+F test/corruptC.test 691ed070baef5e1345939caadf270a52837a5064
 F test/corruptD.test 3ae6e2dc6e2226c6935a8a40d4b5ee3eba75f8c0
 F test/count.test 454e1ce985c94d13efeac405ce54439f49336163
 F test/crash.test 1b6ac8410689ff78028887f445062dc897c9ac89
@@ -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 c6dfc8bd3911b4c93969bfc13d9931965feed674
-R 1f4a85e569a3fef8a6b8dcd856752a00
+P 47b40fefa67f7c563ce2004509aaf8e203038be4
+R addfab017d3e22d0d5d5feaad8fb4028
 U danielk1977
-Z f0c4a06ecb3adf98288d0a45bb531f00
+Z 3a12aba07bf1ffdf9a56a2b90426bf7d
index 13ef29a290b156770018b3045c8003c7aa3b7d67..eda15d108a9076335fd5aa75473a712a1990fb0b 100644 (file)
@@ -1 +1 @@
-47b40fefa67f7c563ce2004509aaf8e203038be4
\ No newline at end of file
+709576c670f802bf4b6e5c0e8db2bbde2cc16a90
\ No newline at end of file
index 44259af3ca18649d8bce47a004b18a03acff0545..5538c42f8562b1ac47bcb14ec00ad0276e665565 100644 (file)
@@ -9,7 +9,7 @@
 **    May you share freely, never taking more than you give.
 **
 *************************************************************************
-** $Id: btree.c,v 1.675 2009/07/11 05:06:52 danielk1977 Exp $
+** $Id: btree.c,v 1.676 2009/07/11 06:55:34 danielk1977 Exp $
 **
 ** This file implements a external (disk-based) database using BTrees.
 ** See the header comment on "btreeInt.h" for additional information.
@@ -7307,6 +7307,10 @@ static int checkTreePage(
        "unable to get the page. error code=%d", rc);
     return 0;
   }
+
+  /* Clear MemPage.isInit to make sure the corruption detection code in
+  ** btreeInitPage() is executed.  */
+  pPage->isInit = 0;
   if( (rc = btreeInitPage(pPage))!=0 ){
     assert( rc==SQLITE_CORRUPT );  /* The only possible error from InitPage */
     checkAppendMsg(pCheck, zContext, 
index 6b8cddd62cbe87d1eae95f0557cec6030224948f..aff7b4a0afa19c4a5e334445bbac7ed6a5e9e7b1 100644 (file)
@@ -15,7 +15,7 @@
 # data base file, then tests that single byte corruptions in 
 # increasingly larger quantities are handled gracefully.
 #
-# $Id: corruptC.test,v 1.13 2009/06/06 19:21:13 drh Exp $
+# $Id: corruptC.test,v 1.14 2009/07/11 06:55:34 danielk1977 Exp $
 
 catch {file delete -force test.db test.db-journal test.bu}
 
@@ -154,9 +154,12 @@ do_test corruptC-2.5 {
   catchsql {BEGIN; UPDATE t2 SET y='abcdef-uvwxyz'; ROLLBACK;}
   catchsql {PRAGMA integrity_check}
 } {0 {{*** in database main ***
-Corruption detected in cell 710 on page 4
-Multiple uses for byte 661 of page 4
-Fragmented space is 249 byte reported as 21 on page 4}}}
+Page 4: btreeInitPage() returns error code 11}}}
+
+# {0 {{*** in database main ***
+# Corruption detected in cell 710 on page 4
+# Multiple uses for byte 661 of page 4
+# Fragmented space is 249 byte reported as 21 on page 4}}}
 
 # test that a corrupt free cell size is handled (seed 169595)
 do_test corruptC-2.6 {