OLD | NEW |
1 # 2014-01-20 | 1 # 2014-01-20 |
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 # | 11 # |
12 | 12 |
13 set testdir [file dirname $argv0] | 13 set testdir [file dirname $argv0] |
14 source $testdir/tester.tcl | 14 source $testdir/tester.tcl |
15 set testprefix corruptH | 15 set testprefix corruptH |
16 | 16 |
17 # Do not use a codec for tests in this file, as the database file is | 17 # This module uses hard-coded offsets which do not work if the reserved_bytes |
18 # manipulated directly using tcl scripts (using the [hexio_write] command). | 18 # value is nonzero. |
19 # | 19 if {[nonzero_reserved_bytes]} {finish_test; return;} |
20 do_not_use_codec | 20 |
21 database_may_be_corrupt | 21 database_may_be_corrupt |
22 | 22 |
23 # The corruption migrations tested by the code in this file are not detected | 23 # The corruption migrations tested by the code in this file are not detected |
24 # mmap mode. | 24 # mmap mode. |
25 # | 25 # |
26 # The reason is that in mmap mode, the different queries may use different | 26 # The reason is that in mmap mode, the different queries may use different |
27 # PgHdr objects for the same page (same data, but different PgHdr container | 27 # PgHdr objects for the same page (same data, but different PgHdr container |
28 # objects). And so the corruption is not detected. | 28 # objects). And so the corruption is not detected. |
29 # | 29 # |
30 if {[permutation]=="mmap"} { | 30 if {[permutation]=="mmap"} { |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 list [catch { | 167 list [catch { |
168 db eval { SELECT * FROM t1 WHERE a IN (1, 2) } { | 168 db eval { SELECT * FROM t1 WHERE a IN (1, 2) } { |
169 db eval { | 169 db eval { |
170 DELETE FROM t2 WHERE c=1; | 170 DELETE FROM t2 WHERE c=1; |
171 } | 171 } |
172 } | 172 } |
173 } msg] $msg | 173 } msg] $msg |
174 } {1 {database disk image is malformed}} | 174 } {1 {database disk image is malformed}} |
175 | 175 |
176 finish_test | 176 finish_test |
177 | |
OLD | NEW |