Modify the integrity-check code so that each b-tree page inspected is reinitialized while doing so, even if an initialized copy exists in the cache. This prevents an assert from failing when running integrity_check on a corrupt database. (CVS 6877)

FossilOrigin-Name: 709576c670f802bf4b6e5c0e8db2bbde2cc16a90
This commit is contained in:
danielk1977
2009-07-11 06:55:33 +00:00
parent 171fff3c9a
commit 93caf5ad93
4 changed files with 20 additions and 13 deletions
+7 -4
View 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 {