sqlite/test/tkt3346.test
drh 588a9a1a1c Defer deleting Table objects associated with flattened subqueries until
all code has been generated, in case some expression node still references
the Table object.  Ticket #3346. (CVS 5650)

FossilOrigin-Name: d04d70336727a0db959c672e6c22cdaa0505dce5
2008-09-01 15:52:10 +00:00

32 lines
919 B
Plaintext

# 2008 September 1
#
# The author disclaims copyright to this source code. In place of
# a legal notice, here is a blessing:
#
# May you do good and not evil.
# May you find forgiveness for yourself and forgive others.
# May you share freely, never taking more than you give.
#
#***********************************************************************
#
# This file implements regression tests for SQLite library. The
# focus of this file is testing the fix for ticket #3346
#
# $Id: tkt3346.test,v 1.1 2008/09/01 15:52:11 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
do_test tkt3346-1.1 {
db eval {
CREATE TABLE t1(a,b);
INSERT INTO t1 VALUES(2,'bob');
INSERT INTO t1 VALUES(1,'alice');
INSERT INTO t1 VALUES(3,'claire');
SELECT *, ( SELECT y FROM (SELECT x.b='alice' AS y) )
FROM ( SELECT * FROM t1 ) AS x;
}
} {2 bob 0 1 alice 1 3 claire 0}
finish_test