OLD | NEW |
1 # 2006 January 31 | 1 # 2006 January 31 |
2 # | 2 # |
3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
5 # | 5 # |
6 # May you do good and not evil. | 6 # May you do good and not evil. |
7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
9 # | 9 # |
10 #*********************************************************************** | 10 #*********************************************************************** |
(...skipping 27 matching lines...) Expand all Loading... |
38 INSERT INTO t2 VALUES(4,444); | 38 INSERT INTO t2 VALUES(4,444); |
39 CREATE INDEX t2i1 ON t2(p); | 39 CREATE INDEX t2i1 ON t2(p); |
40 | 40 |
41 INSERT INTO t3 VALUES(999,'nine'); | 41 INSERT INTO t3 VALUES(999,'nine'); |
42 CREATE INDEX t3i1 ON t3(x); | 42 CREATE INDEX t3i1 ON t3(x); |
43 | 43 |
44 SELECT * FROM t1, t2 LEFT JOIN t3 ON q=x WHERE p=2 AND a=q; | 44 SELECT * FROM t1, t2 LEFT JOIN t3 ON q=x WHERE p=2 AND a=q; |
45 } | 45 } |
46 } {222 two 2 222 {} {}} | 46 } {222 two 2 222 {} {}} |
47 | 47 |
48 ifcapable explain { | 48 ifcapable explain&&!cursorhints { |
49 do_test where3-1.1.1 { | 49 do_test where3-1.1.1 { |
50 explain_no_trace {SELECT * FROM t1, t2 LEFT JOIN t3 ON q=x | 50 explain_no_trace {SELECT * FROM t1, t2 LEFT JOIN t3 ON q=x |
51 WHERE p=2 AND a=q} | 51 WHERE p=2 AND a=q} |
52 } [explain_no_trace {SELECT * FROM t1, t2 LEFT JOIN t3 ON x=q | 52 } [explain_no_trace {SELECT * FROM t1, t2 LEFT JOIN t3 ON x=q |
53 WHERE p=2 AND a=q}] | 53 WHERE p=2 AND a=q}] |
54 } | 54 } |
55 | 55 |
56 # Ticket #1830 | 56 # Ticket #1830 |
57 # | 57 # |
58 # This is similar to the above but with the LEFT JOIN on the | 58 # This is similar to the above but with the LEFT JOIN on the |
(...skipping 20 matching lines...) Expand all Loading... |
79 INSERT INTO child1 ( child1key, value ) VALUES ( 'C1.3', 'Value for C1.3' ); | 79 INSERT INTO child1 ( child1key, value ) VALUES ( 'C1.3', 'Value for C1.3' ); |
80 INSERT INTO child2 ( child2key, value ) VALUES ( 'C2.3', 'Value for C2.3' ); | 80 INSERT INTO child2 ( child2key, value ) VALUES ( 'C2.3', 'Value for C2.3' ); |
81 | 81 |
82 SELECT parent1.parent1key, child1.value, child2.value | 82 SELECT parent1.parent1key, child1.value, child2.value |
83 FROM parent1 | 83 FROM parent1 |
84 LEFT OUTER JOIN child1 ON child1.child1key = parent1.child1key | 84 LEFT OUTER JOIN child1 ON child1.child1key = parent1.child1key |
85 INNER JOIN child2 ON child2.child2key = parent1.child2key; | 85 INNER JOIN child2 ON child2.child2key = parent1.child2key; |
86 } | 86 } |
87 } {1 {Value for C1.1} {Value for C2.1} 2 {} {Value for C2.2} 3 {Value for C1.3}
{Value for C2.3}} | 87 } {1 {Value for C1.1} {Value for C2.1} 2 {} {Value for C2.2} 3 {Value for C1.3}
{Value for C2.3}} |
88 | 88 |
89 ifcapable explain { | 89 ifcapable explain&&!cursorhints { |
90 do_test where3-1.2.1 { | 90 do_test where3-1.2.1 { |
91 explain_no_trace { | 91 explain_no_trace { |
92 SELECT parent1.parent1key, child1.value, child2.value | 92 SELECT parent1.parent1key, child1.value, child2.value |
93 FROM parent1 | 93 FROM parent1 |
94 LEFT OUTER JOIN child1 ON child1.child1key = parent1.child1key | 94 LEFT OUTER JOIN child1 ON child1.child1key = parent1.child1key |
95 INNER JOIN child2 ON child2.child2key = parent1.child2key; | 95 INNER JOIN child2 ON child2.child2key = parent1.child2key; |
96 } | 96 } |
97 } [explain_no_trace { | 97 } [explain_no_trace { |
98 SELECT parent1.parent1key, child1.value, child2.value | 98 SELECT parent1.parent1key, child1.value, child2.value |
99 FROM parent1 | 99 FROM parent1 |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 do_execsql_test where3-7.$disabled_opt.8 { | 481 do_execsql_test where3-7.$disabled_opt.8 { |
482 SELECT x3 FROM t73 LEFT JOIN t74 ON x4=y3; | 482 SELECT x3 FROM t73 LEFT JOIN t74 ON x4=y3; |
483 } {123 123} | 483 } {123 123} |
484 do_execsql_test where3-7.$disabled_opt.9 { | 484 do_execsql_test where3-7.$disabled_opt.9 { |
485 SELECT DISTINCT x3 FROM t73 LEFT JOIN t74 ON x4=y3; | 485 SELECT DISTINCT x3 FROM t73 LEFT JOIN t74 ON x4=y3; |
486 } {123} | 486 } {123} |
487 } | 487 } |
488 | 488 |
489 | 489 |
490 finish_test | 490 finish_test |
OLD | NEW |