-C Update\sutility\sprogram\sspeedtest8inst1.c.\s(CVS\s5201)
-D 2008-06-11T11:00:31
+C Add\sa\stest\scase\sfor\sthe\sdatabase\scorruption\sin\sthe\sform\sof\scell\soffsets\nout\sof\srange\sin\san\sotherwise\svalid\sbtree\spage.\s(CVS\s5202)
+D 2008-06-11T18:01:22
F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7
F Makefile.in ce92ea8dc7adfb743757794f51c10d1b0d9c55e4
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
F test/corrupt4.test acdb01afaedf529004b70e55de1a6f5a05ae7fff
F test/corrupt5.test 7796d5bdfe155ed824cee9dff371f49da237cfe0
F test/corrupt6.test e69b877d478224deab7b66844566258cecacd25e
+F test/corrupt7.test 900d4f9aadd4f78d6977c06f256ea6df662921ab
F test/crash.test 1b6ac8410689ff78028887f445062dc897c9ac89
F test/crash2.test 26d7a4c5520201e5de2c696ea51ab946b59dc0e9
F test/crash3.test 0b09687ae1a3ccbcefdfaeb4b963e26e36255d76
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 1dbced29de5f59ba2ebf877edcadf171540374d1
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P 7dfcd73dc8e97e0bdbe05a22d0ed22b25e5a2786
-R be3baccbbf891ee85b0be23033b91bd1
-U danielk1977
-Z bc0ce3d33a91fd1711f3aee11bae1a91
+P 98bdc7b44db737d3b77aa76c139995d2b185cd85
+R f724ee3e69f515b743bac10237bb979a
+U drh
+Z 4642ac2e7ff23a8e99ee652f9dc55d1e
--- /dev/null
+# 2008 June 11
+#
+# The author disclaims copyright to this source code. In place of
+# a legal notice, here is a blessing:
+#
+# May you do good and not evil.
+# May you find forgiveness for yourself and forgive others.
+# May you share freely, never taking more than you give.
+#
+#***********************************************************************
+# This file implements regression tests for SQLite library.
+#
+# This file implements tests to make sure SQLite does not crash or
+# segfault if it sees a corrupt database file. It specifically focuses
+# on corrupt cell offsets in a btree page.
+#
+# $Id: corrupt7.test,v 1.1 2008/06/11 18:01:22 drh Exp $
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+
+# We must have the page_size pragma for these tests to work.
+#
+ifcapable !pager_pragmas {
+ finish_test
+ return
+}
+
+# Create a simple, small database.
+#
+do_test corrupt7-1.1 {
+ execsql {
+ PRAGMA auto_vacuum=OFF;
+ PRAGMA page_size=1024;
+ CREATE TABLE t1(x);
+ INSERT INTO t1(x) VALUES(1);
+ INSERT INTO t1(x) VALUES(2);
+ INSERT INTO t1(x) SELECT x+2 FROM t1;
+ INSERT INTO t1(x) SELECT x+4 FROM t1;
+ INSERT INTO t1(x) SELECT x+8 FROM t1;
+ }
+ file size test.db
+} [expr {1024*2}]
+
+# Verify that the file format is as we expect. The page size
+# should be 1024 bytes.
+#
+do_test corrupt7-1.2 {
+ hexio_get_int [hexio_read test.db 16 2]
+} 1024 ;# The page size is 1024
+do_test corrupt7-1.3 {
+ hexio_get_int [hexio_read test.db 20 1]
+} 0 ;# Unused bytes per page is 0
+
+integrity_check corrupt7-1.4
+
+# Deliberately corrupt some of the cell offsets in the btree page
+# on page 2 of the database.
+#
+do_test corrupt7-2.1 {
+ db close
+ hexio_write test.db 1062 FF
+ sqlite3 db test.db
+ db eval {PRAGMA integrity_check(1)}
+} {{*** in database main ***
+Corruption detected in cell 15 on page 2}}
+do_test corrupt7-2.2 {
+ db close
+ hexio_write test.db 1062 04
+ sqlite3 db test.db
+ db eval {PRAGMA integrity_check(1)}
+} {{*** in database main ***
+Corruption detected in cell 15 on page 2}}
+
+finish_test