diff options
author | danielk1977 <danielk1977@noemail.net> | 2007-06-25 16:29:33 +0000 |
---|---|---|
committer | danielk1977 <danielk1977@noemail.net> | 2007-06-25 16:29:33 +0000 |
commit | c9cf6e3d31e7ccee23532e0b9941755bc275318c (patch) | |
tree | 3801c6ea9ef746cc893de662356197e40fcd7743 /test/where.test | |
parent | 576d3db541ba9b573984be8451a1033127eb8fb3 (diff) | |
download | sqlite-c9cf6e3d31e7ccee23532e0b9941755bc275318c.tar.gz sqlite-c9cf6e3d31e7ccee23532e0b9941755bc275318c.zip |
Fix for #2445. A bug in the lookupName() logic that could cause a crash when a WHERE clause used an alias to refer to an expression in the result-set of the SELECT, and that expression was itself a reference to a table column. (CVS 4122)
FossilOrigin-Name: 044ca1c72a8f4632dc2e6a94690d164d3560ee38
Diffstat (limited to 'test/where.test')
-rw-r--r-- | test/where.test | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/where.test b/test/where.test index 680772d64..b69e0063d 100644 --- a/test/where.test +++ b/test/where.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this file is testing the use of indices in WHERE clases. # -# $Id: where.test,v 1.42 2007/05/14 11:34:47 drh Exp $ +# $Id: where.test,v 1.43 2007/06/25 16:29:34 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -1137,6 +1137,19 @@ do_test where-14.12 { } } {4/4 4/1 1/4 1/1 sort} +# Ticket #2445. +# +# There was a crash that could occur when a where clause contains an +# alias for an expression in the result set, and that expression retrieves +# a column of the second or subsequent table in a join. +# +do_test where-15.1 { + execsql { + CREATE TEMP TABLE t1 (a, b, c, d, e); + CREATE TEMP TABLE t2 (f); + SELECT t1.e AS alias FROM t2, t1 WHERE alias = 1 ; + } +} {} integrity_check {where-99.0} |