aboutsummaryrefslogtreecommitdiff
path: root/test/where.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/where.test')
-rw-r--r--test/where.test44
1 files changed, 31 insertions, 13 deletions
diff --git a/test/where.test b/test/where.test
index 97f673ec9..680772d64 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.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}