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 #2784 and #2789 have been fixed. sl@0: # sl@0: # $Id: mallocE.test,v 1.3 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 mallocE tests: not compiled with -DSQLITE_MEMDEBUG..." sl@0: finish_test sl@0: return sl@0: } sl@0: sl@0: # ticket #2784 sl@0: # sl@0: set PREP { sl@0: PRAGMA page_size = 1024; sl@0: CREATE TABLE t1(a, b, c); sl@0: CREATE TABLE t2(x, y, z); sl@0: } sl@0: do_malloc_test mallocE-1 -sqlprep $PREP -sqlbody { sl@0: SELECT p, q FROM (SELECT a+b AS p, b+c AS q FROM t1, t2 WHERE c>5) sl@0: LEFT JOIN t2 ON p=x; sl@0: } sl@0: sl@0: # Ticket #2789 sl@0: # sl@0: do_malloc_test mallocE-2 -sqlprep $PREP -sqlbody { sl@0: SELECT x, y2 FROM (SELECT a+b AS x, b+c AS y2 FROM t1, t2 WHERE c>5) sl@0: LEFT JOIN t2 USING(x) WHERE y2>11; sl@0: } sl@0: sl@0: sl@0: finish_test