sl@0: # 2007 Aug 29 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 checks that tickets #2794, #2795, #2796, and #2797 sl@0: # have been fixed. sl@0: # sl@0: # $Id: mallocF.test,v 1.4 2008/02/18 22:24:58 drh Exp $ sl@0: sl@0: set testdir [file dirname $argv0] sl@0: source $testdir/tester.tcl sl@0: source $testdir/malloc_common.tcl sl@0: sl@0: # Only run these tests if memory debugging is turned on. sl@0: # sl@0: if {!$MEMDEBUG} { sl@0: puts "Skipping mallocF tests: not compiled with -DSQLITE_MEMDEBUG..." sl@0: finish_test sl@0: return sl@0: } sl@0: sl@0: # tickets #2794 and #2795 and #2797 sl@0: # sl@0: set PREP { sl@0: CREATE TABLE t1(x,y); sl@0: INSERT INTO t1 VALUES('abc123', 5); sl@0: INSERT INTO t1 VALUES('xyz987', 42); sl@0: } sl@0: do_malloc_test malloeF-1 -sqlprep $PREP -sqlbody { sl@0: SELECT * FROM t1 WHERE x GLOB 'abc*' sl@0: } sl@0: sl@0: # ticket #2796 sl@0: # sl@0: set PREP { sl@0: CREATE TABLE t1(x PRIMARY KEY,y UNIQUE); sl@0: INSERT INTO t1 VALUES('abc123', 5); sl@0: INSERT INTO t1 VALUES('xyz987', 42); sl@0: } sl@0: do_malloc_test malloeF-2 -sqlprep $PREP -sqlbody { sl@0: SELECT x FROM t1 sl@0: WHERE y=1 OR y=2 OR y=3 OR y=4 OR y=5 sl@0: OR y=6 OR y=7 OR y=8 OR y=9 OR y=10 sl@0: OR y=11 OR y=12 OR y=13 OR y=14 OR y=15 sl@0: OR y=x sl@0: } sl@0: sl@0: set PREP { sl@0: CREATE TABLE t1(x PRIMARY KEY,y UNIQUE); sl@0: INSERT INTO t1 VALUES('abc123', 5); sl@0: INSERT INTO t1 VALUES('xyz987', 42); sl@0: } sl@0: do_malloc_test malloeF-3 -sqlprep $PREP -sqlbody { sl@0: SELECT x FROM t1 WHERE y BETWEEN 10 AND 29 sl@0: } sl@0: sl@0: # Ticket #2843 sl@0: # sl@0: set PREP { sl@0: CREATE TABLE t1(x); sl@0: CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN sl@0: SELECT 'hello'; sl@0: END; sl@0: } sl@0: do_malloc_test mallocF-4 -sqlprep $PREP -sqlbody { sl@0: INSERT INTO t1 VALUES(random()); sl@0: } sl@0: sl@0: finish_test