OLD | NEW |
1 # 2005 September 19 | 1 # 2005 September 19 |
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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 do_test join5-2.10 { | 99 do_test join5-2.10 { |
100 execsql {SELECT * FROM xy LEFT JOIN ab ON 0 WHERE NULL} | 100 execsql {SELECT * FROM xy LEFT JOIN ab ON 0 WHERE NULL} |
101 } {} | 101 } {} |
102 do_test join5-2.11 { | 102 do_test join5-2.11 { |
103 execsql {SELECT * FROM xy LEFT JOIN ab ON 1 WHERE NULL} | 103 execsql {SELECT * FROM xy LEFT JOIN ab ON 1 WHERE NULL} |
104 } {} | 104 } {} |
105 do_test join5-2.12 { | 105 do_test join5-2.12 { |
106 execsql {SELECT * FROM xy LEFT JOIN ab ON NULL WHERE NULL} | 106 execsql {SELECT * FROM xy LEFT JOIN ab ON NULL WHERE NULL} |
107 } {} | 107 } {} |
108 | 108 |
| 109 # Ticket https://www.sqlite.org/src/tktview/6f2222d550f5b0ee7ed37601 |
| 110 # Incorrect output on a LEFT JOIN. |
| 111 # |
| 112 do_execsql_test join5-3.1 { |
| 113 DROP TABLE IF EXISTS t1; |
| 114 DROP TABLE IF EXISTS t2; |
| 115 DROP TABLE IF EXISTS t3; |
| 116 CREATE TABLE x1(a); |
| 117 INSERT INTO x1 VALUES(1); |
| 118 CREATE TABLE x2(b NOT NULL); |
| 119 CREATE TABLE x3(c, d); |
| 120 INSERT INTO x3 VALUES('a', NULL); |
| 121 INSERT INTO x3 VALUES('b', NULL); |
| 122 INSERT INTO x3 VALUES('c', NULL); |
| 123 SELECT * FROM x1 LEFT JOIN x2 LEFT JOIN x3 ON x3.d = x2.b; |
| 124 } {1 {} {} {}} |
| 125 do_execsql_test join5-3.2 { |
| 126 DROP TABLE IF EXISTS t1; |
| 127 DROP TABLE IF EXISTS t2; |
| 128 DROP TABLE IF EXISTS t3; |
| 129 DROP TABLE IF EXISTS t4; |
| 130 DROP TABLE IF EXISTS t5; |
| 131 CREATE TABLE t1(x text NOT NULL, y text); |
| 132 CREATE TABLE t2(u text NOT NULL, x text NOT NULL); |
| 133 CREATE TABLE t3(w text NOT NULL, v text); |
| 134 CREATE TABLE t4(w text NOT NULL, z text NOT NULL); |
| 135 CREATE TABLE t5(z text NOT NULL, m text); |
| 136 INSERT INTO t1 VALUES('f6d7661f-4efe-4c90-87b5-858e61cd178b',NULL); |
| 137 INSERT INTO t1 VALUES('f6ea82c3-2cad-45ce-ae8f-3ddca4fb2f48',NULL); |
| 138 INSERT INTO t1 VALUES('f6f47499-ecb4-474b-9a02-35be73c235e5',NULL); |
| 139 INSERT INTO t1 VALUES('56f47499-ecb4-474b-9a02-35be73c235e5',NULL); |
| 140 INSERT INTO t3 VALUES('007f2033-cb20-494c-b135-a1e4eb66130c', |
| 141 'f6d7661f-4efe-4c90-87b5-858e61cd178b'); |
| 142 SELECT * |
| 143 FROM t3 |
| 144 INNER JOIN t1 ON t1.x= t3.v AND t1.y IS NULL |
| 145 LEFT JOIN t4 ON t4.w = t3.w |
| 146 LEFT JOIN t5 ON t5.z = t4.z |
| 147 LEFT JOIN t2 ON t2.u = t5.m |
| 148 LEFT JOIN t1 xyz ON xyz.y = t2.x; |
| 149 } {007f2033-cb20-494c-b135-a1e4eb66130c f6d7661f-4efe-4c90-87b5-858e61cd178b f6d
7661f-4efe-4c90-87b5-858e61cd178b {} {} {} {} {} {} {} {} {}} |
| 150 do_execsql_test join5-3.3 { |
| 151 DROP TABLE IF EXISTS x1; |
| 152 DROP TABLE IF EXISTS x2; |
| 153 DROP TABLE IF EXISTS x3; |
| 154 CREATE TABLE x1(a); |
| 155 INSERT INTO x1 VALUES(1); |
| 156 CREATE TABLE x2(b NOT NULL); |
| 157 CREATE TABLE x3(c, d); |
| 158 INSERT INTO x3 VALUES('a', NULL); |
| 159 INSERT INTO x3 VALUES('b', NULL); |
| 160 INSERT INTO x3 VALUES('c', NULL); |
| 161 SELECT * FROM x1 LEFT JOIN x2 JOIN x3 WHERE x3.d = x2.b; |
| 162 } {} |
109 | 163 |
110 finish_test | 164 finish_test |
OLD | NEW |