os/persistentdata/persistentstorage/sqlite3api/TEST/TclScript/softheap1.test
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/persistentstorage/sqlite3api/TEST/TclScript/softheap1.test	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,50 @@
     1.4 +# 2007 Aug 10
     1.5 +#
     1.6 +# The author disclaims copyright to this source code.  In place of
     1.7 +# a legal notice, here is a blessing:
     1.8 +#
     1.9 +#    May you do good and not evil.
    1.10 +#    May you find forgiveness for yourself and forgive others.
    1.11 +#    May you share freely, never taking more than you give.
    1.12 +#
    1.13 +#***********************************************************************
    1.14 +# 
    1.15 +# This test script reproduces the problem reported by ticket #2565,
    1.16 +# A database corruption bug that occurs in auto_vacuum mode when
    1.17 +# the soft_heap_limit is set low enough to be triggered.
    1.18 +#
    1.19 +# $Id: softheap1.test,v 1.5 2008/07/08 17:13:59 danielk1977 Exp $
    1.20 +
    1.21 +
    1.22 +set testdir [file dirname $argv0]
    1.23 +source $testdir/tester.tcl
    1.24 +
    1.25 +ifcapable !integrityck {
    1.26 +  finish_test
    1.27 +  return
    1.28 +}
    1.29 +
    1.30 +sqlite3_soft_heap_limit -1
    1.31 +sqlite3_soft_heap_limit 0
    1.32 +sqlite3_soft_heap_limit 5000
    1.33 +do_test softheap1-1.1 {
    1.34 +  execsql {
    1.35 +    PRAGMA auto_vacuum=1;
    1.36 +    CREATE TABLE t1(x);
    1.37 +    INSERT INTO t1 VALUES(hex(randomblob(1000)));
    1.38 +    BEGIN;
    1.39 +  }
    1.40 +  execsql {
    1.41 +    CREATE TABLE t2 AS SELECT * FROM t1;
    1.42 +  }
    1.43 +  execsql {
    1.44 +    ROLLBACK;
    1.45 +  }
    1.46 +  execsql {
    1.47 +    PRAGMA integrity_check;
    1.48 +  }
    1.49 +} {ok}
    1.50 +
    1.51 +sqlite3_soft_heap_limit $soft_limit
    1.52 +   
    1.53 +finish_test