]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add LEFT JOIN test cases for multi-index OR in where9.test. (CVS 6085)
authordrh <drh@noemail.net>
Tue, 30 Dec 2008 16:35:53 +0000 (16:35 +0000)
committerdrh <drh@noemail.net>
Tue, 30 Dec 2008 16:35:53 +0000 (16:35 +0000)
FossilOrigin-Name: 96f3b62914adde34079f08428b4e2fe81c193612

manifest
manifest.uuid
test/where9.test

index 1198daf85edf723fa60fe2469b518018d092d6a7..0daedfc60ef8956f5b1a8e942797e0f1d4339d6e 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Get\sEXPLAIN\sQUERY\sPLAN\sworking\swith\sthe\smulti-index\sOR\soptimization.\nAdded\snew\stest\sscript\s"where9.test".\s(CVS\s6084)
-D 2008-12-30T16:18:48
+C Add\sLEFT\sJOIN\stest\scases\sfor\smulti-index\sOR\sin\swhere9.test.\s(CVS\s6085)
+D 2008-12-30T16:35:53
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in 77635d0909c2067cee03889a1e04ce910d8fb809
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -658,7 +658,7 @@ F test/where6.test 42c4373595f4409d9c6a9987b4a60000ad664faf
 F test/where7.test c56c34e84f2bf8d4c787cf8ee6ce8b705468b8cb
 F test/where8.test 1b9152a086408ee789166d0a954abc597372f868
 F test/where8m.test c1010d61826412ff66abd29bfb32e5d6b37d965c
-F test/where9.test 99b2da7fe4d319875e822608d8a68e33c7ba6b3b
+F test/where9.test 3115a2f703c016749666e632e372a190274b14f2
 F test/wherelimit.test 5e9fd41e79bb2b2d588ed999d641d9c965619b31
 F test/zeroblob.test 792124852ec61458a2eb527b5091791215e0be95
 F tool/diffdb.c 7524b1b5df217c20cd0431f6789851a4e0cb191b
@@ -689,7 +689,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P e01f6ef9d981d50a70c05edc4ef8135dbc473ba1
-R 656eed84794d51b57bb6008ae413f374
+P 4b6460221011e02bedb724169e8e4793e539e65a
+R 2cc1de2de75d01575a76221c12614ec0
 U drh
-Z e4b8ae188f3b3547cc0bff76a1c6fe50
+Z 6391d47122122bc1f091deaa9ddd4b9b
index 2dc0063afe8cec9279a5689762c5c4a9fbef71c8..6c604eb709365c18f000bb3c9726eb20bf7e247b 100644 (file)
@@ -1 +1 @@
-4b6460221011e02bedb724169e8e4793e539e65a
\ No newline at end of file
+96f3b62914adde34079f08428b4e2fe81c193612
\ No newline at end of file
index ed7ce997953e53fc16a904db026ffdcc312df911..cbd579660d32b6e34d84e8c04a3231bf6a6b8966 100644 (file)
@@ -11,7 +11,7 @@
 # This file implements regression tests for SQLite library.  The
 # focus of this file is testing the multi-index OR clause optimizer.
 #
-# $Id: where9.test,v 1.1 2008/12/30 16:18:48 drh Exp $
+# $Id: where9.test,v 1.2 2008/12/30 16:35:53 drh Exp $
 
 set testdir [file dirname $argv0]
 source $testdir/tester.tcl
@@ -148,6 +148,9 @@ do_test where9-1.1 {
     CREATE INDEX t2e ON t2(e,f,g);
     CREATE INDEX t2f ON t2(f,b,d,c);
     CREATE INDEX t2g ON t2(g,f);
+    CREATE TABLE t3(x,y);
+    INSERT INTO t3 VALUES(1,80);
+    INSERT INTO t3 VALUES(2,80);
   }
 } {}
 
@@ -270,6 +273,40 @@ do_test where9-2.4 {
     ORDER BY 1
   }
 } {9999 scan 0 sort 1}
+do_test where9-2.5 {
+  count_steps {
+    SELECT t1.a, coalesce(t2.a,9999)
+      FROM t1 LEFT JOIN t2 ON (t1.c=t2.c AND t1.d=t2.d) OR (t1.f)=t2.f
+     WHERE t1.a=80 OR t1.b=880 OR (t1.c=27027 AND round(t1.d)==80)
+    ORDER BY 1
+  }
+} {80 2 80 28 80 54 80 80 scan 0 sort 0}
+do_test where9-2.6 {
+  count_steps {
+    SELECT t1.a, coalesce(t2.a,9999)
+      FROM t1 LEFT JOIN t2 ON (t1.c+1=t2.c AND t1.d=t2.d) OR (t1.f||'x')=t2.f
+     WHERE t1.a=80 OR t1.b=880 OR (t1.c=27027 AND round(t1.d)==80)
+    ORDER BY 1
+  }
+} {80 9999 scan 0 sort 0}
+do_test where9-2.7 {
+  count_steps {
+    SELECT t3.x, t1.a, coalesce(t2.a,9999)
+      FROM t3 JOIN
+           t1 LEFT JOIN t2 ON (t1.c+1=t2.c AND t1.d=t2.d) OR (t1.f||'x')=t2.f
+     WHERE t1.a=t3.y OR t1.b=t3.y*11 OR (t1.c=27027 AND round(t1.d)==80)
+    ORDER BY 1, 2
+  }
+} {1 80 9999 2 80 9999 scan 1 sort 1}
+do_test where9-2.8 {
+  count_steps {
+    SELECT t3.x, t1.a, coalesce(t2.a,9999)
+      FROM t3 JOIN
+           t1 LEFT JOIN t2 ON (t1.c=t2.c AND t1.d=t2.d) OR (t1.f)=t2.f
+     WHERE t1.a=t3.y OR t1.b=t3.y*11 OR (t1.c=27027 AND round(t1.d)==80)
+    ORDER BY 1, 2
+  }
+} {1 80 2 1 80 28 1 80 54 1 80 80 2 80 2 2 80 28 2 80 54 2 80 80 scan 1 sort 1}
 
 
 ifcapable explain {