CoolFace
Modelpublic

AryaWu/sqlite

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
mallocF.test77 linesDownload Raw Back to test
1# 2007 Aug 292#3# The author disclaims copyright to this source code.  In place of4# 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 checks that tickets #2794, #2795, #2796, and #279713# have been fixed.14# 15# $Id: mallocF.test,v 1.4 2008/02/18 22:24:58 drh Exp $16 17set testdir [file dirname $argv0]18source $testdir/tester.tcl19source $testdir/malloc_common.tcl20 21# Only run these tests if memory debugging is turned on.22#23if {!$MEMDEBUG} {24   puts "Skipping mallocF tests: not compiled with -DSQLITE_MEMDEBUG..."25   finish_test26   return27}28 29# tickets #2794 and #2795 and #279730#31set PREP {32  CREATE TABLE t1(x,y);33  INSERT INTO t1 VALUES('abc123', 5);34  INSERT INTO t1 VALUES('xyz987', 42);35}36do_malloc_test malloeF-1 -sqlprep $PREP -sqlbody {37  SELECT * FROM t1 WHERE x GLOB 'abc*'38}39 40# ticket #279641#42set PREP {43  CREATE TABLE t1(x PRIMARY KEY,y UNIQUE);44  INSERT INTO t1 VALUES('abc123', 5);45  INSERT INTO t1 VALUES('xyz987', 42);46}47do_malloc_test malloeF-2 -sqlprep $PREP -sqlbody {48  SELECT x FROM t149   WHERE y=1 OR y=2 OR y=3 OR y=4 OR y=550      OR y=6 OR y=7 OR y=8 OR y=9 OR y=1051      OR y=11 OR y=12 OR y=13 OR y=14 OR y=1552      OR y=x53}54 55set PREP {56  CREATE TABLE t1(x PRIMARY KEY,y UNIQUE);57  INSERT INTO t1 VALUES('abc123', 5);58  INSERT INTO t1 VALUES('xyz987', 42);59}60do_malloc_test malloeF-3 -sqlprep $PREP -sqlbody {61  SELECT x FROM t1 WHERE y BETWEEN 10 AND 2962}63 64# Ticket #284365#66set PREP {67  CREATE TABLE t1(x);68  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN69    SELECT 'hello';70  END;71}72do_malloc_test mallocF-4 -sqlprep $PREP -sqlbody {73  INSERT INTO t1 VALUES(random());74}75 76finish_test77