Enhance the command-line completion extension to return the names of
[sqlite.git] / test / mallocF.test
blob0015005fec91a191bcd338f79e8e193d30aeb796
1 # 2007 Aug 29
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 checks that tickets #2794, #2795, #2796, and #2797
13 # have been fixed.
14
15 # $Id: mallocF.test,v 1.4 2008/02/18 22:24:58 drh Exp $
17 set testdir [file dirname $argv0]
18 source $testdir/tester.tcl
19 source $testdir/malloc_common.tcl
21 # Only run these tests if memory debugging is turned on.
23 if {!$MEMDEBUG} {
24    puts "Skipping mallocF tests: not compiled with -DSQLITE_MEMDEBUG..."
25    finish_test
26    return
29 # tickets #2794 and #2795 and #2797
31 set PREP {
32   CREATE TABLE t1(x,y);
33   INSERT INTO t1 VALUES('abc123', 5);
34   INSERT INTO t1 VALUES('xyz987', 42);
36 do_malloc_test malloeF-1 -sqlprep $PREP -sqlbody {
37   SELECT * FROM t1 WHERE x GLOB 'abc*'
40 # ticket #2796
42 set PREP {
43   CREATE TABLE t1(x PRIMARY KEY,y UNIQUE);
44   INSERT INTO t1 VALUES('abc123', 5);
45   INSERT INTO t1 VALUES('xyz987', 42);
47 do_malloc_test malloeF-2 -sqlprep $PREP -sqlbody {
48   SELECT x FROM t1
49    WHERE y=1 OR y=2 OR y=3 OR y=4 OR y=5
50       OR y=6 OR y=7 OR y=8 OR y=9 OR y=10
51       OR y=11 OR y=12 OR y=13 OR y=14 OR y=15
52       OR y=x
55 set PREP {
56   CREATE TABLE t1(x PRIMARY KEY,y UNIQUE);
57   INSERT INTO t1 VALUES('abc123', 5);
58   INSERT INTO t1 VALUES('xyz987', 42);
60 do_malloc_test malloeF-3 -sqlprep $PREP -sqlbody {
61   SELECT x FROM t1 WHERE y BETWEEN 10 AND 29
64 # Ticket #2843
66 set PREP {
67   CREATE TABLE t1(x);
68   CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
69     SELECT 'hello';
70   END;
72 do_malloc_test mallocF-4 -sqlprep $PREP -sqlbody {
73   INSERT INTO t1 VALUES(random());
76 finish_test