OLD | NEW |
| (Empty) |
1 # 2007 Aug 10 | |
2 # | |
3 # The author disclaims copyright to this source code. In place of | |
4 # a legal notice, here is a blessing: | |
5 # | |
6 # May you do good and not evil. | |
7 # May you find forgiveness for yourself and forgive others. | |
8 # May you share freely, never taking more than you give. | |
9 # | |
10 #*********************************************************************** | |
11 # | |
12 # This test script reproduces the problem reported by ticket #2565, | |
13 # A database corruption bug that occurs in auto_vacuum mode when | |
14 # the soft_heap_limit is set low enough to be triggered. | |
15 # | |
16 # $Id: softheap1.test,v 1.5 2008/07/08 17:13:59 danielk1977 Exp $ | |
17 | |
18 | |
19 set testdir [file dirname $argv0] | |
20 source $testdir/tester.tcl | |
21 | |
22 ifcapable !integrityck { | |
23 finish_test | |
24 return | |
25 } | |
26 | |
27 do_test softheap1-1.0 { | |
28 execsql {PRAGMA soft_heap_limit} | |
29 } [sqlite3_soft_heap_limit -1] | |
30 do_test softheap1-1.1 { | |
31 execsql {PRAGMA soft_heap_limit=123456; PRAGMA soft_heap_limit;} | |
32 } {123456 123456} | |
33 do_test softheap1-1.2 { | |
34 sqlite3_soft_heap_limit -1 | |
35 } {123456} | |
36 do_test softheap1-1.3 { | |
37 execsql {PRAGMA soft_heap_limit(-1); PRAGMA soft_heap_limit;} | |
38 } {123456 123456} | |
39 do_test softheap1-1.4 { | |
40 execsql {PRAGMA soft_heap_limit(0); PRAGMA soft_heap_limit;} | |
41 } {0 0} | |
42 | |
43 sqlite3_soft_heap_limit 5000 | |
44 do_test softheap1-2.0 { | |
45 execsql {PRAGMA soft_heap_limit} | |
46 } {5000} | |
47 do_test softheap1-2.1 { | |
48 execsql { | |
49 PRAGMA auto_vacuum=1; | |
50 CREATE TABLE t1(x); | |
51 INSERT INTO t1 VALUES(hex(randomblob(1000))); | |
52 BEGIN; | |
53 } | |
54 execsql { | |
55 CREATE TABLE t2 AS SELECT * FROM t1; | |
56 } | |
57 execsql { | |
58 ROLLBACK; | |
59 } | |
60 execsql { | |
61 PRAGMA integrity_check; | |
62 } | |
63 } {ok} | |
64 | |
65 sqlite3_soft_heap_limit $cmdlinearg(soft-heap-limit) | |
66 finish_test | |
OLD | NEW |