Futher simplifications to the NGQP. Fix some test cases to use

EXPLAIN QUERY PLAN rather than the (now obsolete) sqlite_query_plan
global variable.

FossilOrigin-Name: ae985db4fa08b5efbef5a834e852f0b05101264b
This commit is contained in:
drh
2013-05-30 19:29:19 +00:00
parent 70bdcc738e
commit 6fa978dade
5 changed files with 70 additions and 148 deletions
+24 -25
View File
@@ -65,9 +65,9 @@ proc count sql {
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_eqp_test where-1.1.2 {
SELECT x, y, w FROM t1 WHERE w=10
} {*SEARCH TABLE t1 USING INDEX i1w (w=?) *}
do_test where-1.1.3 {
db status step
} {0}
@@ -77,15 +77,15 @@ do_test where-1.1.4 {
do_test where-1.1.5 {
db status step
} {99}
do_test where-1.1.6 {
set sqlite_query_plan
} {t1 {}}
do_eqp_test where-1.1.6 {
SELECT x, y, w FROM t1 WHERE +w=10
} {*SCAN TABLE t1 *}
do_test where-1.1.7 {
count {SELECT x, y, w AS abc FROM t1 WHERE abc=10}
} {3 121 10 3}
do_test where-1.1.8 {
set sqlite_query_plan
} {t1 i1w}
do_eqp_test where-1.1.8 {
SELECT x, y, w AS abc FROM t1 WHERE abc=10
} {*SEARCH TABLE t1 USING INDEX i1w (w=?) *}
do_test where-1.1.9 {
db status step
} {0}
@@ -104,21 +104,21 @@ do_test where-1.3.2 {
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_eqp_test where-1.4.2 {
SELECT w, x, y FROM t1 WHERE 11=w AND x>2
} {*SEARCH TABLE t1 USING INDEX i1w (w=?) *}
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_eqp_test where-1.4.4 {
SELECT w AS a, x AS b, y FROM t1 WHERE 11=a AND b>2
} {*SEARCH TABLE t1 USING INDEX i1w (w=?) *}
do_test where-1.5 {
count {SELECT x, y FROM t1 WHERE y<200 AND w=11 AND x>2}
} {3 144 3}
do_test where-1.5.2 {
set sqlite_query_plan
} {t1 i1w}
do_eqp_test where-1.5.2 {
SELECT x, y FROM t1 WHERE y<200 AND w=11 AND x>2
} {*SEARCH TABLE t1 USING INDEX i1w (w=?) *}
do_test where-1.6 {
count {SELECT x, y FROM t1 WHERE y<200 AND x>2 AND w=11}
} {3 144 3}
@@ -128,13 +128,12 @@ do_test where-1.7 {
do_test where-1.8 {
count {SELECT x, y FROM t1 WHERE w>10 AND y=144 AND x=3}
} {3 144 3}
do_test where-1.8.2 {
set sqlite_query_plan
} {t1 i1xy}
do_test where-1.8.3 {
count {SELECT x, y FROM t1 WHERE y=144 AND x=3}
set sqlite_query_plan
} {{} i1xy}
do_eqp_test where-1.8.2 {
SELECT x, y FROM t1 WHERE w>10 AND y=144 AND x=3
} {*SEARCH TABLE t1 USING INDEX i1xy (x=? AND y=?) *}
do_eqp_test where-1.8.3 {
SELECT x, y FROM t1 WHERE y=144 AND x=3
} {*SEARCH TABLE t1 USING COVERING INDEX i1xy (x=? AND y=?) *}
do_test where-1.9 {
count {SELECT x, y FROM t1 WHERE y=144 AND w>10 AND x=3}
} {3 144 3}