3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
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.
10 #***********************************************************************
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.
16 # $Id: softheap1.test,v 1.5 2008/07/08 17:13:59 danielk1977 Exp $
19 set testdir [file dirname $argv0]
20 source $testdir/tester.tcl
22 ifcapable !integrityck {
27 # EVIDENCE-OF: R-26343-45930 This pragma invokes the
28 # sqlite3_soft_heap_limit64() interface with the argument N, if N is
29 # specified and is a non-negative integer.
31 # EVIDENCE-OF: R-64451-07163 The soft_heap_limit pragma always returns
32 # the same integer that would be returned by the
33 # sqlite3_soft_heap_limit64(-1) C-language function.
35 do_test softheap1-1.0 {
36 execsql {PRAGMA soft_heap_limit}
37 } [sqlite3_soft_heap_limit -1]
38 do_test softheap1-1.1 {
39 execsql {PRAGMA soft_heap_limit=123456; PRAGMA soft_heap_limit;}
41 do_test softheap1-1.2 {
42 sqlite3_soft_heap_limit -1
44 do_test softheap1-1.3 {
45 execsql {PRAGMA soft_heap_limit(-1); PRAGMA soft_heap_limit;}
47 do_test softheap1-1.4 {
48 execsql {PRAGMA soft_heap_limit(0); PRAGMA soft_heap_limit;}
51 sqlite3_soft_heap_limit 5000
52 do_test softheap1-2.0 {
53 execsql {PRAGMA soft_heap_limit}
55 do_test softheap1-2.1 {
59 INSERT INTO t1 VALUES(hex(randomblob(1000)));
63 CREATE TABLE t2 AS SELECT * FROM t1;
69 PRAGMA integrity_check;
73 sqlite3_soft_heap_limit $cmdlinearg(soft-heap-limit)