OLD | NEW |
1 # 2005 July 28 | 1 # 2005 July 28 |
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 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 } 1000 | 613 } 1000 |
614 ifcapable subquery { | 614 ifcapable subquery { |
615 do_test where2-9.2 { | 615 do_test where2-9.2 { |
616 count { | 616 count { |
617 SELECT * FROM t10 WHERE a=1 AND (b=2 OR b=3) | 617 SELECT * FROM t10 WHERE a=1 AND (b=2 OR b=3) |
618 } | 618 } |
619 } {1 2 2 1 3 3 7} | 619 } {1 2 2 1 3 3 7} |
620 } | 620 } |
621 } | 621 } |
622 | 622 |
| 623 # Indices with redundant columns |
| 624 # |
| 625 do_test where2-11.1 { |
| 626 execsql { |
| 627 CREATE TABLE t11(a,b,c,d); |
| 628 CREATE INDEX i11aba ON t11(a,b,a,c); -- column A occurs twice. |
| 629 INSERT INTO t11 VALUES(1,2,3,4); |
| 630 INSERT INTO t11 VALUES(5,6,7,8); |
| 631 INSERT INTO t11 VALUES(1,2,9,10); |
| 632 INSERT INTO t11 VALUES(5,11,12,13); |
| 633 SELECT c FROM t11 WHERE a=1 AND b=2 ORDER BY c; |
| 634 } |
| 635 } {3 9} |
| 636 do_test where2-11.2 { |
| 637 execsql { |
| 638 CREATE INDEX i11cccccccc ON t11(c,c,c,c,c,c,c,c); -- repeated column |
| 639 SELECT d FROM t11 WHERE c=9; |
| 640 } |
| 641 } {10} |
| 642 do_test where2-11.3 { |
| 643 execsql { |
| 644 SELECT d FROM t11 WHERE c IN (1,2,3,4,5); |
| 645 } |
| 646 } {4} |
| 647 do_test where2-11.4 { |
| 648 execsql { |
| 649 SELECT d FROM t11 WHERE c=7 OR (a=1 AND b=2) ORDER BY d; |
| 650 } |
| 651 } {4 8 10} |
| 652 |
| 653 |
623 finish_test | 654 finish_test |
OLD | NEW |