OLD | NEW |
1 # | 1 # |
2 # 2001 September 15 | 2 # 2001 September 15 |
3 # | 3 # |
4 # The author disclaims copyright to this source code. In place of | 4 # The author disclaims copyright to this source code. In place of |
5 # a legal notice, here is a blessing: | 5 # a legal notice, here is a blessing: |
6 # | 6 # |
7 # May you do good and not evil. | 7 # May you do good and not evil. |
8 # May you find forgiveness for yourself and forgive others. | 8 # May you find forgiveness for yourself and forgive others. |
9 # May you share freely, never taking more than you give. | 9 # May you share freely, never taking more than you give. |
10 # | 10 # |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 execsql { | 297 execsql { |
298 SELECT (c1||'') COLLATE numeric FROM collate1t1 ORDER BY 1; | 298 SELECT (c1||'') COLLATE numeric FROM collate1t1 ORDER BY 1; |
299 } | 299 } |
300 } {{} 1 12 101} | 300 } {{} 1 12 101} |
301 do_test collate1-4.5 { | 301 do_test collate1-4.5 { |
302 execsql { | 302 execsql { |
303 DROP TABLE collate1t1; | 303 DROP TABLE collate1t1; |
304 } | 304 } |
305 } {} | 305 } {} |
306 | 306 |
| 307 # A problem reported on the mailing list: A CREATE TABLE statement |
| 308 # is allowed to have two or more COLLATE clauses on the same column. |
| 309 # That probably ought to be an error, but we allow it for backwards |
| 310 # compatibility. Just make sure it works and doesn't leak memory. |
| 311 # |
| 312 do_test collate1-5.1 { |
| 313 execsql { |
| 314 CREATE TABLE c5( |
| 315 id INTEGER PRIMARY KEY, |
| 316 a TEXT COLLATE binary COLLATE nocase COLLATE rtrim, |
| 317 b TEXT COLLATE nocase COLLATE binary, |
| 318 c TEXT COLLATE rtrim COLLATE binary COLLATE rtrim COLLATE nocase |
| 319 ); |
| 320 INSERT INTO c5 VALUES(1, 'abc','abc','abc'); |
| 321 INSERT INTO c5 VALUES(2, 'abc ','ABC','ABC'); |
| 322 SELECT id FROM c5 WHERE a='abc' ORDER BY id; |
| 323 } |
| 324 } {1 2} |
| 325 do_test collate1-5.2 { |
| 326 execsql { |
| 327 SELECT id FROM c5 WHERE b='abc' ORDER BY id; |
| 328 } |
| 329 } {1} |
| 330 do_test collate1-5.3 { |
| 331 execsql { |
| 332 SELECT id FROM c5 WHERE c='abc' ORDER BY id; |
| 333 } |
| 334 } {1 2} |
| 335 |
307 finish_test | 336 finish_test |
OLD | NEW |