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

Unified Diff: third_party/sqlite/src/test/whereD.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/where8m.test ('k') | third_party/sqlite/src/test/whereI.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/whereD.test
diff --git a/third_party/sqlite/src/test/whereD.test b/third_party/sqlite/src/test/whereD.test
index 17fdac7017c5d592870d4040a65a2cbe3fe00c15..8ced0ffc723ac9b2bc4816269a46cb9b06df4d1e 100644
--- a/third_party/sqlite/src/test/whereD.test
+++ b/third_party/sqlite/src/test/whereD.test
@@ -156,7 +156,7 @@ do_searchcount_test 3.4.4 {
do_searchcount_test 3.5.1 {
SELECT a, b FROM t3 WHERE (a=1 AND b='one') OR rowid=4
-} {1 one 2 two search 3}
+} {1 one 2 two search 2}
do_searchcount_test 3.5.2 {
SELECT a, c FROM t3 WHERE (a=1 AND b='one') OR rowid=4
} {1 i 2 ii search 3}
@@ -271,5 +271,147 @@ do_execsql_test 5.3 {
c16=1 or c17=1;
} {1 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 1 {} {}}
+#-------------------------------------------------------------------------
+do_execsql_test 6.1 {
+ CREATE TABLE x1(a, b, c, d, e);
+ CREATE INDEX x1a ON x1(a);
+ CREATE INDEX x1bc ON x1(b, c);
+ CREATE INDEX x1cd ON x1(c, d);
+
+ INSERT INTO x1 VALUES(1, 2, 3, 4, 'A');
+ INSERT INTO x1 VALUES(5, 6, 7, 8, 'B');
+ INSERT INTO x1 VALUES(9, 10, 11, 12, 'C');
+ INSERT INTO x1 VALUES(13, 14, 15, 16, 'D');
+}
+
+do_searchcount_test 6.2.1 {
+ SELECT e FROM x1 WHERE b=2 OR c=7;
+} {A B search 6}
+do_searchcount_test 6.2.2 {
+ SELECT c FROM x1 WHERE b=2 OR c=7;
+} {3 7 search 4}
+
+do_searchcount_test 6.3.1 {
+ SELECT e FROM x1 WHERE a=1 OR b=10;
+} {A C search 6}
+do_searchcount_test 6.3.2 {
+ SELECT c FROM x1 WHERE a=1 OR b=10;
+} {3 11 search 5}
+do_searchcount_test 6.3.3 {
+ SELECT rowid FROM x1 WHERE a=1 OR b=10;
+} {1 3 search 4}
+
+do_searchcount_test 6.4.1 {
+ SELECT a FROM x1 WHERE b BETWEEN 1 AND 4 OR c BETWEEN 8 AND 12
+} {1 9 search 6}
+do_searchcount_test 6.4.2 {
+ SELECT b, c FROM x1 WHERE b BETWEEN 1 AND 4 OR c BETWEEN 8 AND 12
+} {2 3 10 11 search 5}
+do_searchcount_test 6.4.3 {
+ SELECT rowid, c FROM x1 WHERE b BETWEEN 1 AND 4 OR c BETWEEN 8 AND 12
+} {1 3 3 11 search 4}
+
+do_searchcount_test 6.5.1 {
+ SELECT a FROM x1 WHERE rowid = 2 OR c=11
+} {5 9 search 3}
+do_searchcount_test 6.5.2 {
+ SELECT d FROM x1 WHERE rowid = 2 OR c=11
+} {8 12 search 2}
+do_searchcount_test 6.5.3 {
+ SELECT d FROM x1 WHERE c=11 OR rowid = 2
+} {12 8 search 2}
+do_searchcount_test 6.5.4 {
+ SELECT a FROM x1 WHERE c=11 OR rowid = 2
+} {9 5 search 3}
+
+do_searchcount_test 6.6.1 {
+ SELECT rowid FROM x1 WHERE a=1 OR b=6 OR c=11
+} {1 2 3 search 6}
+do_searchcount_test 6.6.2 {
+ SELECT c FROM x1 WHERE a=1 OR b=6 OR c=11
+} {3 7 11 search 7}
+do_searchcount_test 6.6.3 {
+ SELECT c FROM x1 WHERE c=11 OR a=1 OR b=6
+} {11 3 7 search 7}
+do_searchcount_test 6.6.4 {
+ SELECT c FROM x1 WHERE b=6 OR c=11 OR a=1
+} {7 11 3 search 7}
+
+#-------------------------------------------------------------------------
+#
+do_execsql_test 7.0 {
+ CREATE TABLE y1(a, b);
+ CREATE TABLE y2(x, y);
+ CREATE INDEX y2xy ON y2(x, y);
+ INSERT INTO y1 VALUES(1, 1);
+ INSERT INTO y2 VALUES(3, 3);
+}
+
+do_execsql_test 7.1 {
+ SELECT * FROM y1 LEFT JOIN y2 ON ((x=1 AND y=b) OR (x=2 AND y=b))
+} {1 1 {} {}}
+
+do_execsql_test 7.3 {
+ CREATE TABLE foo (Id INTEGER PRIMARY KEY, fa INTEGER, fb INTEGER);
+ CREATE TABLE bar (Id INTEGER PRIMARY KEY, ba INTEGER, bb INTEGER);
+
+ INSERT INTO foo VALUES(1, 1, 1);
+ INSERT INTO foo VALUES(2, 1, 2);
+ INSERT INTO foo VALUES(3, 1, 3);
+ INSERT INTO foo VALUES(4, 1, 4);
+ INSERT INTO foo VALUES(5, 1, 5);
+ INSERT INTO foo VALUES(6, 1, 6);
+ INSERT INTO foo VALUES(7, 1, 7);
+ INSERT INTO foo VALUES(8, 1, 8);
+ INSERT INTO foo VALUES(9, 1, 9);
+
+ INSERT INTO bar VALUES(NULL, 1, 1);
+ INSERT INTO bar VALUES(NULL, 2, 2);
+ INSERT INTO bar VALUES(NULL, 3, 3);
+ INSERT INTO bar VALUES(NULL, 1, 4);
+ INSERT INTO bar VALUES(NULL, 2, 5);
+ INSERT INTO bar VALUES(NULL, 3, 6);
+ INSERT INTO bar VALUES(NULL, 1, 7);
+ INSERT INTO bar VALUES(NULL, 2, 8);
+ INSERT INTO bar VALUES(NULL, 3, 9);
+}
+
+do_execsql_test 7.4 {
+ SELECT
+ bar.Id, bar.ba, bar.bb, foo.fb
+ FROM foo LEFT JOIN bar
+ ON (bar.ba = 1 AND bar.bb = foo.fb)
+ OR (bar.ba = 5 AND bar.bb = foo.fb);
+} {
+ 1 1 1 1
+ {} {} {} 2
+ {} {} {} 3
+ 4 1 4 4
+ {} {} {} 5
+ {} {} {} 6
+ 7 1 7 7
+ {} {} {} 8
+ {} {} {} 9
+}
+
+do_execsql_test 7.5 {
+ CREATE INDEX idx_bar ON bar(ba, bb);
+ SELECT
+ bar.Id, bar.ba, bar.bb, foo.fb
+ FROM foo LEFT JOIN bar
+ ON (bar.ba = 1 AND bar.bb = foo.fb)
+ OR (bar.ba = 5 AND bar.bb = foo.fb);
+} {
+ 1 1 1 1
+ {} {} {} 2
+ {} {} {} 3
+ 4 1 4 4
+ {} {} {} 5
+ {} {} {} 6
+ 7 1 7 7
+ {} {} {} 8
+ {} {} {} 9
+}
+
finish_test
« no previous file with comments | « third_party/sqlite/src/test/where8m.test ('k') | third_party/sqlite/src/test/whereI.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698