sl@0: # 2007 Aug 10 sl@0: # sl@0: # The author disclaims copyright to this source code. In place of sl@0: # a legal notice, here is a blessing: sl@0: # sl@0: # May you do good and not evil. sl@0: # May you find forgiveness for yourself and forgive others. sl@0: # May you share freely, never taking more than you give. sl@0: # sl@0: #*********************************************************************** sl@0: # sl@0: # This test script reproduces the problem reported by ticket #2565, sl@0: # A database corruption bug that occurs in auto_vacuum mode when sl@0: # the soft_heap_limit is set low enough to be triggered. sl@0: # sl@0: # $Id: softheap1.test,v 1.5 2008/07/08 17:13:59 danielk1977 Exp $ sl@0: sl@0: sl@0: set testdir [file dirname $argv0] sl@0: source $testdir/tester.tcl sl@0: sl@0: ifcapable !integrityck { sl@0: finish_test sl@0: return sl@0: } sl@0: sl@0: sqlite3_soft_heap_limit -1 sl@0: sqlite3_soft_heap_limit 0 sl@0: sqlite3_soft_heap_limit 5000 sl@0: do_test softheap1-1.1 { sl@0: execsql { sl@0: PRAGMA auto_vacuum=1; sl@0: CREATE TABLE t1(x); sl@0: INSERT INTO t1 VALUES(hex(randomblob(1000))); sl@0: BEGIN; sl@0: } sl@0: execsql { sl@0: CREATE TABLE t2 AS SELECT * FROM t1; sl@0: } sl@0: execsql { sl@0: ROLLBACK; sl@0: } sl@0: execsql { sl@0: PRAGMA integrity_check; sl@0: } sl@0: } {ok} sl@0: sl@0: sqlite3_soft_heap_limit $soft_limit sl@0: sl@0: finish_test