1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/persistentdata/persistentstorage/sqlite3api/TEST/TclScript/mallocE.test Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,48 @@
1.4 +# 2007 Aug 29
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 checks that tickets #2784 and #2789 have been fixed.
1.16 +#
1.17 +# $Id: mallocE.test,v 1.3 2008/02/18 22:24:58 drh Exp $
1.18 +
1.19 +set testdir [file dirname $argv0]
1.20 +source $testdir/tester.tcl
1.21 +source $testdir/malloc_common.tcl
1.22 +
1.23 +# Only run these tests if memory debugging is turned on.
1.24 +#
1.25 +if {!$MEMDEBUG} {
1.26 + puts "Skipping mallocE tests: not compiled with -DSQLITE_MEMDEBUG..."
1.27 + finish_test
1.28 + return
1.29 +}
1.30 +
1.31 +# ticket #2784
1.32 +#
1.33 +set PREP {
1.34 + PRAGMA page_size = 1024;
1.35 + CREATE TABLE t1(a, b, c);
1.36 + CREATE TABLE t2(x, y, z);
1.37 +}
1.38 +do_malloc_test mallocE-1 -sqlprep $PREP -sqlbody {
1.39 + SELECT p, q FROM (SELECT a+b AS p, b+c AS q FROM t1, t2 WHERE c>5)
1.40 + LEFT JOIN t2 ON p=x;
1.41 +}
1.42 +
1.43 +# Ticket #2789
1.44 +#
1.45 +do_malloc_test mallocE-2 -sqlprep $PREP -sqlbody {
1.46 + SELECT x, y2 FROM (SELECT a+b AS x, b+c AS y2 FROM t1, t2 WHERE c>5)
1.47 + LEFT JOIN t2 USING(x) WHERE y2>11;
1.48 +}
1.49 +
1.50 +
1.51 +finish_test