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

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

Issue 1610963002: Import SQLite 3.10.2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/shrink.test ('k') | third_party/sqlite/src/test/skipscan6.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 6b9f1209a5b5e899a288da4a7e8f0ee4eb99f5c1..ac26711603bb1c1b515a2d6e757e40860967186c 100644
--- a/third_party/sqlite/src/test/skipscan1.test
+++ b/third_party/sqlite/src/test/skipscan1.test
@@ -273,4 +273,53 @@ do_execsql_test skipscan1-6.3 {
EXPLAIN QUERY PLAN SELECT * FROM t1 WHERE b=1;
} {~/ANY/}
+# If the sqlite_stat1 entry includes the "noskipscan" token, then never use
+# skipscan with that index.
+#
+do_execsql_test skipscan1-7.1 {
+ UPDATE sqlite_stat1 SET stat='500000 125000 1 sz=100';
+ ANALYZE sqlite_master;
+ EXPLAIN QUERY PLAN SELECT * FROM t1 WHERE b=1;
+} {/ANY/}
+do_execsql_test skipscan1-7.2 {
+ UPDATE sqlite_stat1 SET stat='500000 125000 1 noskipscan sz=100';
+ ANALYZE sqlite_master;
+ EXPLAIN QUERY PLAN SELECT * FROM t1 WHERE b=1;
+} {~/ANY/}
+do_execsql_test skipscan1-7.3 {
+ UPDATE sqlite_stat1 SET stat='500000 125000 1 sz=100 noskipscan';
+ ANALYZE sqlite_master;
+ EXPLAIN QUERY PLAN SELECT * FROM t1 WHERE b=1;
+} {~/ANY/}
+
+# Ticket 8fd39115d8f46ece70e7d4b3c481d1bd86194746 2015-07-23
+# Incorrect code generated for a skipscan within an OR optimization
+# on a WITHOUT ROWID table.
+#
+do_execsql_test skipscan1-8.1 {
+ DROP TABLE IF EXISTS t1;
+ CREATE TABLE t1(x, y, PRIMARY KEY(x,y)) WITHOUT ROWID;
+ INSERT INTO t1(x,y) VALUES(1,'AB');
+ INSERT INTO t1(x,y) VALUES(2,'CD');
+ ANALYZE;
+ DROP TABLE IF EXISTS sqlite_stat4;
+ DELETE FROM sqlite_stat1;
+ INSERT INTO sqlite_stat1(tbl,idx,stat) VALUES('t1','t1','1000000 100 1');
+ ANALYZE sqlite_master;
+ SELECT * FROM t1
+ WHERE (y = 'AB' AND x <= 4)
+ OR (y = 'EF' AND x = 5);
+} {1 AB}
+do_execsql_test skipscan1-8.1eqp {
+ EXPLAIN QUERY PLAN
+ SELECT * FROM t1
+ WHERE (y = 'AB' AND x <= 4)
+ OR (y = 'EF' AND x = 5);
+} {/ANY/}
+do_execsql_test skipscan1-8.2 {
+ SELECT * FROM t1
+ WHERE y = 'AB' OR (y = 'CD' AND x = 2)
+ ORDER BY +x;
+} {1 AB 2 CD}
+
finish_test
« no previous file with comments | « third_party/sqlite/src/test/shrink.test ('k') | third_party/sqlite/src/test/skipscan6.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698