OLD | NEW |
1 # 2012 August 24 | 1 # 2012 August 24 |
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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 INSERT INTO t3 VALUES(4, 'four', 'iv'); | 122 INSERT INTO t3 VALUES(4, 'four', 'iv'); |
123 INSERT INTO t3 VALUES(5, 'five', 'v'); | 123 INSERT INTO t3 VALUES(5, 'five', 'v'); |
124 | 124 |
125 CREATE TABLE t4(x PRIMARY KEY, y); | 125 CREATE TABLE t4(x PRIMARY KEY, y); |
126 INSERT INTO t4 VALUES('a', 'one'); | 126 INSERT INTO t4 VALUES('a', 'one'); |
127 INSERT INTO t4 VALUES('b', 'two'); | 127 INSERT INTO t4 VALUES('b', 'two'); |
128 } | 128 } |
129 | 129 |
130 do_searchcount_test 3.1 { | 130 do_searchcount_test 3.1 { |
131 SELECT a, b FROM t3 WHERE (a=1 AND b='one') OR (a=2 AND b='two') | 131 SELECT a, b FROM t3 WHERE (a=1 AND b='one') OR (a=2 AND b='two') |
132 } {1 one 2 two search 2} | 132 } {1 one 2 two search 4} |
133 | 133 |
134 do_searchcount_test 3.2 { | 134 do_searchcount_test 3.2 { |
135 SELECT a, c FROM t3 WHERE (a=1 AND b='one') OR (a=2 AND b='two') | 135 SELECT a, c FROM t3 WHERE (a=1 AND b='one') OR (a=2 AND b='two') |
136 } {1 i 2 ii search 4} | 136 } {1 i 2 ii search 6} |
137 | 137 |
138 do_searchcount_test 3.4.1 { | 138 do_searchcount_test 3.4.1 { |
139 SELECT y FROM t4 WHERE x='a' | 139 SELECT y FROM t4 WHERE x='a' |
140 } {one search 2} | 140 } {one search 2} |
141 do_searchcount_test 3.4.2 { | 141 do_searchcount_test 3.4.2 { |
142 SELECT a, b FROM t3 WHERE | 142 SELECT a, b FROM t3 WHERE |
143 (a=1 AND b=(SELECT y FROM t4 WHERE x='a')) | 143 (a=1 AND b=(SELECT y FROM t4 WHERE x='a')) |
144 OR (a=2 AND b='two') | 144 OR (a=2 AND b='two') |
145 } {1 one 2 two search 4} | 145 } {1 one 2 two search 6} |
146 do_searchcount_test 3.4.3 { | 146 do_searchcount_test 3.4.3 { |
147 SELECT a, b FROM t3 WHERE | 147 SELECT a, b FROM t3 WHERE |
148 (a=2 AND b='two') | 148 (a=2 AND b='two') |
149 OR (a=1 AND b=(SELECT y FROM t4 WHERE x='a')) | 149 OR (a=1 AND b=(SELECT y FROM t4 WHERE x='a')) |
150 } {2 two 1 one search 4} | 150 } {2 two 1 one search 6} |
151 do_searchcount_test 3.4.4 { | 151 do_searchcount_test 3.4.4 { |
152 SELECT a, b FROM t3 WHERE | 152 SELECT a, b FROM t3 WHERE |
153 (a=2 AND b=(SELECT y FROM t4 WHERE x='b')) | 153 (a=2 AND b=(SELECT y FROM t4 WHERE x='b')) |
154 OR (a=1 AND b=(SELECT y FROM t4 WHERE x='a')) | 154 OR (a=1 AND b=(SELECT y FROM t4 WHERE x='a')) |
155 } {2 two 1 one search 6} | 155 } {2 two 1 one search 8} |
156 | 156 |
157 do_searchcount_test 3.5.1 { | 157 do_searchcount_test 3.5.1 { |
158 SELECT a, b FROM t3 WHERE (a=1 AND b='one') OR rowid=4 | 158 SELECT a, b FROM t3 WHERE (a=1 AND b='one') OR rowid=4 |
159 } {1 one 2 two search 2} | 159 } {1 one 2 two search 3} |
160 do_searchcount_test 3.5.2 { | 160 do_searchcount_test 3.5.2 { |
161 SELECT a, c FROM t3 WHERE (a=1 AND b='one') OR rowid=4 | 161 SELECT a, c FROM t3 WHERE (a=1 AND b='one') OR rowid=4 |
162 } {1 i 2 ii search 2} | 162 } {1 i 2 ii search 3} |
163 | 163 |
164 # Ticket [d02e1406a58ea02d] (2012-10-04) | 164 # Ticket [d02e1406a58ea02d] (2012-10-04) |
165 # LEFT JOIN with an OR in the ON clause causes segfault | 165 # LEFT JOIN with an OR in the ON clause causes segfault |
166 # | 166 # |
167 do_test 4.1 { | 167 do_test 4.1 { |
168 db eval { | 168 db eval { |
169 CREATE TABLE t41(a,b,c); | 169 CREATE TABLE t41(a,b,c); |
170 INSERT INTO t41 VALUES(1,2,3), (4,5,6); | 170 INSERT INTO t41 VALUES(1,2,3), (4,5,6); |
171 CREATE TABLE t42(d,e,f); | 171 CREATE TABLE t42(d,e,f); |
172 INSERT INTO t42 VALUES(3,6,9), (4,8,12); | 172 INSERT INTO t42 VALUES(3,6,9), (4,8,12); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 SELECT * FROM t WHERE | 266 SELECT * FROM t WHERE |
267 c0=1 or c1=1 or c2=1 or c3=1 or | 267 c0=1 or c1=1 or c2=1 or c3=1 or |
268 c4=1 or c5=1 or c6=1 or c7=1 or | 268 c4=1 or c5=1 or c6=1 or c7=1 or |
269 c8=1 or c9=1 or c10=1 or c11=1 or | 269 c8=1 or c9=1 or c10=1 or c11=1 or |
270 c12=1 or c13=1 or c14=1 or c15=1 or | 270 c12=1 or c13=1 or c14=1 or c15=1 or |
271 c16=1 or c17=1; | 271 c16=1 or c17=1; |
272 } {1 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 1 {} {}} | 272 } {1 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 1 {} {}} |
273 | 273 |
274 | 274 |
275 finish_test | 275 finish_test |
OLD | NEW |