blob: e87bc8b3afc3b86dc2483e392e47e3fe73571cf9 [file] [log] [blame]
drhcfa063b2007-11-21 15:24:00 +00001# 2007 Aug 29
2#
3# The author disclaims copyright to this source code. In place of
4# 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#
drhf4ce8ed2007-11-23 13:42:51 +000012# This test script checks that tickets #2784 and #2789 have been fixed.
drhcfa063b2007-11-21 15:24:00 +000013#
drheee4c8c2008-02-18 22:24:57 +000014# $Id: mallocE.test,v 1.3 2008/02/18 22:24:58 drh Exp $
drhcfa063b2007-11-21 15:24:00 +000015
16set testdir [file dirname $argv0]
17source $testdir/tester.tcl
drheee4c8c2008-02-18 22:24:57 +000018source $testdir/malloc_common.tcl
drhcfa063b2007-11-21 15:24:00 +000019
20# Only run these tests if memory debugging is turned on.
21#
drheee4c8c2008-02-18 22:24:57 +000022if {!$MEMDEBUG} {
drhcfa063b2007-11-21 15:24:00 +000023 puts "Skipping mallocE tests: not compiled with -DSQLITE_MEMDEBUG..."
24 finish_test
25 return
26}
drhcfa063b2007-11-21 15:24:00 +000027
drhf4ce8ed2007-11-23 13:42:51 +000028# ticket #2784
29#
drhcfa063b2007-11-21 15:24:00 +000030set PREP {
31 PRAGMA page_size = 1024;
32 CREATE TABLE t1(a, b, c);
33 CREATE TABLE t2(x, y, z);
34}
drhcfa063b2007-11-21 15:24:00 +000035do_malloc_test mallocE-1 -sqlprep $PREP -sqlbody {
36 SELECT p, q FROM (SELECT a+b AS p, b+c AS q FROM t1, t2 WHERE c>5)
37 LEFT JOIN t2 ON p=x;
38}
39
drhf4ce8ed2007-11-23 13:42:51 +000040# Ticket #2789
41#
42do_malloc_test mallocE-2 -sqlprep $PREP -sqlbody {
43 SELECT x, y2 FROM (SELECT a+b AS x, b+c AS y2 FROM t1, t2 WHERE c>5)
44 LEFT JOIN t2 USING(x) WHERE y2>11;
45}
46
47
drhcfa063b2007-11-21 15:24:00 +000048finish_test