Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(871)

Unified Diff: third_party/sqlite/src/test/skipscan1.test

Issue 2751253002: [sql] Import SQLite 3.17.0. (Closed)
Patch Set: also clang on Linux i386 Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/sqlite/src/test/shell7.test ('k') | third_party/sqlite/src/test/snapshot.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/skipscan1.test
diff --git a/third_party/sqlite/src/test/skipscan1.test b/third_party/sqlite/src/test/skipscan1.test
index ac26711603bb1c1b515a2d6e757e40860967186c..6cdeed5439400beded3c7e9f79d32d91a3ca1354 100644
--- a/third_party/sqlite/src/test/skipscan1.test
+++ b/third_party/sqlite/src/test/skipscan1.test
@@ -43,23 +43,23 @@ do_execsql_test skipscan1-1.2 {
} {abc 345 7 8 | def 345 9 10 |}
do_execsql_test skipscan1-1.2eqp {
EXPLAIN QUERY PLAN
- SELECT a,b,c,d,'|' FROM t1 WHERE b=345 ORDER BY a;
+ SELECT a,b,c,d,'|' FROM t1 WHERE d<>99 AND b=345 ORDER BY a;
} {/* USING INDEX t1abc (ANY(a) AND b=?)*/}
do_execsql_test skipscan1-1.2sort {
EXPLAIN QUERY PLAN
- SELECT a,b,c,d,'|' FROM t1 WHERE b=345 ORDER BY a;
+ SELECT a,b,c,d,'|' FROM t1 WHERE d<>99 AND b=345 ORDER BY a;
} {~/*ORDER BY*/}
do_execsql_test skipscan1-1.3 {
- SELECT a,b,c,d,'|' FROM t1 WHERE b=345 ORDER BY a DESC;
+ SELECT a,b,c,d,'|' FROM t1 WHERE d<>99 AND b=345 ORDER BY a DESC;
} {def 345 9 10 | abc 345 7 8 |}
do_execsql_test skipscan1-1.3eqp {
EXPLAIN QUERY PLAN
- SELECT a,b,c,d,'|' FROM t1 WHERE b=345 ORDER BY a;
+ SELECT a,b,c,d,'|' FROM t1 WHERE d<>99 AND b=345 ORDER BY a DESC;
} {/* USING INDEX t1abc (ANY(a) AND b=?)*/}
do_execsql_test skipscan1-1.3sort {
EXPLAIN QUERY PLAN
- SELECT a,b,c,d,'|' FROM t1 WHERE b=345 ORDER BY a;
+ SELECT a,b,c,d,'|' FROM t1 WHERE d<>99 AND b=345 ORDER BY a DESC;
} {~/*ORDER BY*/}
do_execsql_test skipscan1-1.4 {
@@ -150,15 +150,15 @@ do_execsql_test skipscan1-2.1 {
} {}
do_execsql_test skipscan1-2.2 {
- SELECT a,b,c,d,'|' FROM t2 WHERE b=345 ORDER BY a;
+ SELECT a,b,c,d,'|' FROM t2 WHERE d<>99 AND b=345 ORDER BY a;
} {abc 345 7 8 | def 345 9 10 |}
do_execsql_test skipscan1-2.2eqp {
EXPLAIN QUERY PLAN
- SELECT a,b,c,d,'|' FROM t2 WHERE b=345 ORDER BY a;
+ SELECT a,b,c,d,'|' FROM t2 WHERE d<>99 AND b=345 ORDER BY a;
} {/* USING INDEX sqlite_autoindex_t2_1 (ANY(a) AND b=?)*/}
do_execsql_test skipscan1-2.2sort {
EXPLAIN QUERY PLAN
- SELECT a,b,c,d,'|' FROM t2 WHERE b=345 ORDER BY a;
+ SELECT a,b,c,d,'|' FROM t2 WHERE d<>99 AND b=345 ORDER BY a;
} {~/*ORDER BY*/}
@@ -322,4 +322,19 @@ do_execsql_test skipscan1-8.2 {
ORDER BY +x;
} {1 AB 2 CD}
+# Segfault reported on the mailing list by Keith Medcalf on 2016-09-18.
+# A skip-scan with a "column IN (SELECT ...)" on the second term of the
+# index.
+#
+do_execsql_test skipscan1-9.2 {
+ CREATE TABLE t9a(a,b,c);
+ CREATE INDEX t9a_ab ON t9a(a,b);
+ CREATE TABLE t9b(x,y);
+ ANALYZE sqlite_master;
+ INSERT INTO sqlite_stat1 VALUES('t9a','t9a_ab','1000000 250000 1');
+ ANALYZE sqlite_master;
+ EXPLAIN QUERY PLAN
+ SELECT * FROM t9a WHERE b IN (SELECT x FROM t9b WHERE y!=5);
+} {/USING INDEX t9a_ab .ANY.a. AND b=./}
+
finish_test
« no previous file with comments | « third_party/sqlite/src/test/shell7.test ('k') | third_party/sqlite/src/test/snapshot.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698