1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-09 14:21:03 +03:00

Do not ignore alias "a" in a query of the form "SELECT ... FROM (...) AS a" Fix for #3935. Also expand upon (6751) to fix some similar obscure memory leaks. (CVS 6831)

FossilOrigin-Name: 42f9d1e56483a59353bff57d75f09ed67e1d9c3c
This commit is contained in:
danielk1977
2009-07-01 14:56:39 +00:00
parent 96d48e963a
commit 9b87d7b904
5 changed files with 73 additions and 15 deletions

54
test/tkt3935.test Normal file
View File

@@ -0,0 +1,54 @@
# 2009 July 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.
#
# This file implements tests to verify that ticket #3935 has been fixed.
#
# $Id: tkt3935.test,v 1.1 2009/07/01 14:56:41 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
do_test tkt3935.1 {
execsql {
CREATE TABLE t1(a, b);
CREATE TABLE t2(c, d);
}
} {}
do_test tkt3935.2 {
execsql { SELECT j1.b FROM ( SELECT * FROM t1 INNER JOIN t2 ON a=c ) AS j1 }
} {}
do_test tkt3935.3 {
execsql { SELECT j1.b FROM (t1 INNER JOIN t2 ON a=c) AS j1 }
} {}
do_test tkt3935.4 {
execsql { SELECT a FROM (t1) AS t ON b USING(a) }
} {}
do_test tkt3935.5 {
execsql { SELECT a FROM (t1) AS t ON b }
} {}
do_test tkt3935.6 {
execsql { SELECT a FROM (SELECT * FROM t1) AS t ON b USING(a) }
} {}
do_test tkt3935.7 {
execsql { SELECT a FROM (SELECT * FROM t1) AS t ON b }
} {}
do_test tkt3935.8 {
execsql { SELECT a FROM t1 AS t ON b }
} {}
do_test tkt3935.9 {
execsql { SELECT a FROM t1 AS t ON b USING(a) }
} {}
finish_test