mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
Remove terms with operator TK_AS from the expression tree. Ticket #2356. (CVS 3991)
FossilOrigin-Name: 5627ff74be9242418434a06fe5c104d1f9128cab
This commit is contained in:
@ -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.41 2007/02/06 23:41:34 drh Exp $
|
||||
# $Id: where.test,v 1.42 2007/05/14 11:34:47 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -62,24 +62,42 @@ proc count sql {
|
||||
# and Next operators in the VDBE. By verifing that the search count is
|
||||
# small we can be assured that indices are being used properly.
|
||||
#
|
||||
do_test where-1.1 {
|
||||
count {SELECT x, y FROM t1 WHERE w=10}
|
||||
} {3 121 3}
|
||||
do_test where-1.1.1 {
|
||||
count {SELECT x, y, w FROM t1 WHERE w=10}
|
||||
} {3 121 10 3}
|
||||
do_test where-1.1.2 {
|
||||
set sqlite_query_plan
|
||||
} {t1 i1w}
|
||||
do_test where-1.2 {
|
||||
count {SELECT x, y FROM t1 WHERE w=11}
|
||||
} {3 144 3}
|
||||
do_test where-1.3 {
|
||||
count {SELECT x, y FROM t1 WHERE 11=w}
|
||||
} {3 144 3}
|
||||
do_test where-1.4 {
|
||||
count {SELECT x, y FROM t1 WHERE 11=w AND x>2}
|
||||
} {3 144 3}
|
||||
do_test where-1.1.3 {
|
||||
count {SELECT x, y, w AS abc FROM t1 WHERE abc=10}
|
||||
} {3 121 10 3}
|
||||
do_test where-1.1.4 {
|
||||
set sqlite_query_plan
|
||||
} {t1 i1w}
|
||||
do_test where-1.2.1 {
|
||||
count {SELECT x, y, w FROM t1 WHERE w=11}
|
||||
} {3 144 11 3}
|
||||
do_test where-1.2.2 {
|
||||
count {SELECT x, y, w AS abc FROM t1 WHERE abc=11}
|
||||
} {3 144 11 3}
|
||||
do_test where-1.3.1 {
|
||||
count {SELECT x, y, w AS abc FROM t1 WHERE 11=w}
|
||||
} {3 144 11 3}
|
||||
do_test where-1.3.2 {
|
||||
count {SELECT x, y, w AS abc FROM t1 WHERE 11=abc}
|
||||
} {3 144 11 3}
|
||||
do_test where-1.4.1 {
|
||||
count {SELECT w, x, y FROM t1 WHERE 11=w AND x>2}
|
||||
} {11 3 144 3}
|
||||
do_test where-1.4.2 {
|
||||
set sqlite_query_plan
|
||||
} {t1 i1w}
|
||||
do_test where-1.4.3 {
|
||||
count {SELECT w AS a, x AS b, y FROM t1 WHERE 11=a AND b>2}
|
||||
} {11 3 144 3}
|
||||
do_test where-1.4.4 {
|
||||
set sqlite_query_plan
|
||||
} {t1 i1w}
|
||||
do_test where-1.5 {
|
||||
count {SELECT x, y FROM t1 WHERE y<200 AND w=11 AND x>2}
|
||||
} {3 144 3}
|
||||
|
Reference in New Issue
Block a user