OLD | NEW |
1 # 2012 September 17 | 1 # 2012 September 17 |
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 do_test 4.1 { | 82 do_test 4.1 { |
83 db eval {SELECT a FROM t1} | 83 db eval {SELECT a FROM t1} |
84 } {3 4 5} | 84 } {3 4 5} |
85 do_test 4.2 { | 85 do_test 4.2 { |
86 db eval {SELECT a, c FROM t1} | 86 db eval {SELECT a, c FROM t1} |
87 } {5 3 4 2 3 1} | 87 } {5 3 4 2 3 1} |
88 do_test 4.3 { | 88 do_test 4.3 { |
89 db eval {SELECT b FROM t1} | 89 db eval {SELECT b FROM t1} |
90 } {2 4 8} | 90 } {2 4 8} |
91 | 91 |
| 92 #------------------------------------------------------------------------- |
| 93 # Test that indexes with large numbers of columns can be correctly |
| 94 # identified as covering indexes. |
| 95 reset_db |
| 96 set L [list] |
| 97 for {set i 1} {$i<120} {incr i} { |
| 98 lappend L "c$i" |
| 99 } |
| 100 set cols [join $L ,] |
| 101 |
| 102 do_execsql_test 5.1.0 " |
| 103 CREATE TABLE t1(a, b, c, $cols, PRIMARY KEY(a, b, c)) WITHOUT ROWID; |
| 104 CREATE INDEX i1 ON t1($cols); |
| 105 |
| 106 CREATE TABLE t2(i INTEGER PRIMARY KEY, $cols); |
| 107 CREATE INDEX i2 ON t2($cols); |
| 108 " |
| 109 |
| 110 do_eqp_test 5.1.1 { |
| 111 SELECT * FROM t1 ORDER BY c1, c2; |
| 112 } { |
| 113 0 0 0 {SCAN TABLE t1 USING COVERING INDEX i1} |
| 114 } |
| 115 |
| 116 do_eqp_test 5.1.2 { |
| 117 SELECT * FROM t2 ORDER BY c1, c2; |
| 118 } { |
| 119 0 0 0 {SCAN TABLE t2 USING COVERING INDEX i2} |
| 120 } |
| 121 |
| 122 |
92 | 123 |
93 finish_test | 124 finish_test |
OLD | NEW |