OLD | NEW |
1 # 2008 June 11 | 1 # 2008 June 11 |
2 # | 2 # |
3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
5 # | 5 # |
6 # May you do good and not evil. | 6 # May you do good and not evil. |
7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
9 # | 9 # |
10 #*********************************************************************** | 10 #*********************************************************************** |
11 # This file implements regression tests for SQLite library. | 11 # This file implements regression tests for SQLite library. |
12 # | 12 # |
13 # This file implements tests to make sure SQLite does not crash or | 13 # This file implements tests to make sure SQLite does not crash or |
14 # segfault if it sees a corrupt database file. It specifically focuses | 14 # segfault if it sees a corrupt database file. It specifically focuses |
15 # on corrupt cell offsets in a btree page. | 15 # on corrupt cell offsets in a btree page. |
16 # | 16 # |
17 # $Id: corrupt7.test,v 1.8 2009/08/10 10:18:08 danielk1977 Exp $ | 17 # $Id: corrupt7.test,v 1.8 2009/08/10 10:18:08 danielk1977 Exp $ |
18 | 18 |
19 set testdir [file dirname $argv0] | 19 set testdir [file dirname $argv0] |
20 source $testdir/tester.tcl | 20 source $testdir/tester.tcl |
21 | 21 |
22 # Do not use a codec for tests in this file, as the database file is | 22 # This module uses hard-coded offsets which do not work if the reserved_bytes |
23 # manipulated directly using tcl scripts (using the [hexio_write] command). | 23 # value is nonzero. |
24 # | 24 if {[nonzero_reserved_bytes]} {finish_test; return;} |
25 do_not_use_codec | |
26 | 25 |
27 # These tests deal with corrupt database files | 26 # These tests deal with corrupt database files |
28 # | 27 # |
29 database_may_be_corrupt | 28 database_may_be_corrupt |
30 | 29 |
31 # We must have the page_size pragma for these tests to work. | 30 # We must have the page_size pragma for these tests to work. |
32 # | 31 # |
33 ifcapable !pager_pragmas { | 32 ifcapable !pager_pragmas { |
34 finish_test | 33 finish_test |
35 return | 34 return |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 # # reference invalid memory. | 103 # # reference invalid memory. |
105 # hexio_write test.db $cell_offset FFFF7F | 104 # hexio_write test.db $cell_offset FFFF7F |
106 # | 105 # |
107 # sqlite3 db test.db | 106 # sqlite3 db test.db |
108 # catchsql { | 107 # catchsql { |
109 # SELECT b FROM t1 WHERE b > 'o' AND b < 'p'; | 108 # SELECT b FROM t1 WHERE b > 'o' AND b < 'p'; |
110 # } | 109 # } |
111 #} {1 {database disk image is malformed}} | 110 #} {1 {database disk image is malformed}} |
112 | 111 |
113 finish_test | 112 finish_test |
OLD | NEW |