File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / sqlite3 / test / softheap1.test
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 17:04:16 2012 UTC (12 years, 4 months ago) by misho
Branches: sqlite3, MAIN
CVS tags: v3_7_10, HEAD
sqlite3

    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.1.1.1 2012/02/21 17:04:16 misho 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: sqlite3_soft_heap_limit -1
   28: sqlite3_soft_heap_limit 0
   29: sqlite3_soft_heap_limit 5000
   30: do_test softheap1-1.1 {
   31:   execsql {
   32:     PRAGMA auto_vacuum=1;
   33:     CREATE TABLE t1(x);
   34:     INSERT INTO t1 VALUES(hex(randomblob(1000)));
   35:     BEGIN;
   36:   }
   37:   execsql {
   38:     CREATE TABLE t2 AS SELECT * FROM t1;
   39:   }
   40:   execsql {
   41:     ROLLBACK;
   42:   }
   43:   execsql {
   44:     PRAGMA integrity_check;
   45:   }
   46: } {ok}
   47: 
   48: sqlite3_soft_heap_limit $cmdlinearg(soft-heap-limit)
   49: finish_test

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>