drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 1 | # Copyright (c) 1999, 2000 D. Richard Hipp |
| 2 | # |
| 3 | # This program is free software; you can redistribute it and/or |
| 4 | # modify it under the terms of the GNU General Public |
| 5 | # License as published by the Free Software Foundation; either |
| 6 | # version 2 of the License, or (at your option) any later version. |
| 7 | # |
| 8 | # This program is distributed in the hope that it will be useful, |
| 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 | # General Public License for more details. |
| 12 | # |
| 13 | # You should have received a copy of the GNU General Public |
| 14 | # License along with this library; if not, write to the |
| 15 | # Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 16 | # Boston, MA 02111-1307, USA. |
| 17 | # |
| 18 | # Author contact information: |
| 19 | # drh@hwaci.com |
| 20 | # http://www.hwaci.com/drh/ |
| 21 | # |
| 22 | #*********************************************************************** |
| 23 | # This file implements regression tests for SQLite library. The |
| 24 | # focus of this file is testing the CREATE INDEX statement. |
| 25 | # |
drh | 2803757 | 2000-08-02 13:47:41 +0000 | [diff] [blame^] | 26 | # $Id: index.test,v 1.7 2000/08/02 13:47:42 drh Exp $ |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 27 | |
| 28 | set testdir [file dirname $argv0] |
| 29 | source $testdir/tester.tcl |
| 30 | |
| 31 | # Create a basic index and verify it is added to sqlite_master |
| 32 | # |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 33 | do_test index-1.1 { |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 34 | execsql {CREATE TABLE test1(f1 int, f2 int, f3 int)} |
| 35 | execsql {CREATE INDEX index1 ON test1(f1)} |
drh | 2803757 | 2000-08-02 13:47:41 +0000 | [diff] [blame^] | 36 | execsql {SELECT name FROM sqlite_master WHERE type!='meta' ORDER BY name} |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 37 | } {index1 test1} |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 38 | do_test index-1.1b { |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 39 | execsql {SELECT name, sql, tbl_name, type FROM sqlite_master |
| 40 | WHERE name='index1'} |
| 41 | } {index1 {CREATE INDEX index1 ON test1(f1)} test1 index} |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 42 | do_test index-1.1c { |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 43 | db close |
| 44 | sqlite db testdb |
| 45 | execsql {SELECT name, sql, tbl_name, type FROM sqlite_master |
| 46 | WHERE name='index1'} |
| 47 | } {index1 {CREATE INDEX index1 ON test1(f1)} test1 index} |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 48 | do_test index-1.1d { |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 49 | db close |
| 50 | sqlite db testdb |
drh | 2803757 | 2000-08-02 13:47:41 +0000 | [diff] [blame^] | 51 | execsql {SELECT name FROM sqlite_master WHERE type!='meta' ORDER BY name} |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 52 | } {index1 test1} |
| 53 | |
| 54 | # Verify that the index dies with the table |
| 55 | # |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 56 | do_test index-1.2 { |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 57 | execsql {DROP TABLE test1} |
drh | 2803757 | 2000-08-02 13:47:41 +0000 | [diff] [blame^] | 58 | execsql {SELECT name FROM sqlite_master WHERE type!='meta' ORDER BY name} |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 59 | } {} |
| 60 | |
| 61 | # Try adding an index to a table that does not exist |
| 62 | # |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 63 | do_test index-2.1 { |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 64 | set v [catch {execsql {CREATE INDEX index1 ON test1(f1)}} msg] |
| 65 | lappend v $msg |
| 66 | } {1 {no such table: test1}} |
| 67 | |
drh | 1ccde15 | 2000-06-17 13:12:39 +0000 | [diff] [blame] | 68 | # Try adding an index on a column of a table where the table |
| 69 | # exists but the column does not. |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 70 | # |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 71 | do_test index-2.1 { |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 72 | execsql {CREATE TABLE test1(f1 int, f2 int, f3 int)} |
| 73 | set v [catch {execsql {CREATE INDEX index1 ON test1(f4)}} msg] |
| 74 | lappend v $msg |
drh | 1ccde15 | 2000-06-17 13:12:39 +0000 | [diff] [blame] | 75 | } {1 {table test1 has no column named f4}} |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 76 | |
drh | 1ccde15 | 2000-06-17 13:12:39 +0000 | [diff] [blame] | 77 | # Try an index with some columns that match and others that do now. |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 78 | # |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 79 | do_test index-2.2 { |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 80 | set v [catch {execsql {CREATE INDEX index1 ON test1(f1, f2, f4, f3)}} msg] |
| 81 | execsql {DROP TABLE test1} |
| 82 | lappend v $msg |
drh | 1ccde15 | 2000-06-17 13:12:39 +0000 | [diff] [blame] | 83 | } {1 {table test1 has no column named f4}} |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 84 | |
| 85 | # Try creating a bunch of indices on the same table |
| 86 | # |
| 87 | set r {} |
| 88 | for {set i 1} {$i<100} {incr i} { |
| 89 | lappend r index$i |
| 90 | } |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 91 | do_test index-3.1 { |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 92 | execsql {CREATE TABLE test1(f1 int, f2 int, f3 int, f4 int, f5 int)} |
| 93 | for {set i 1} {$i<100} {incr i} { |
| 94 | set sql "CREATE INDEX index$i ON test1(f[expr {($i%5)+1}])" |
| 95 | execsql $sql |
| 96 | } |
| 97 | execsql {SELECT name FROM sqlite_master |
| 98 | WHERE type='index' AND tbl_name='test1' |
| 99 | ORDER BY name} |
| 100 | } $r |
| 101 | |
| 102 | # Add a single entry to the table. Verify that files are created |
| 103 | # for every index. |
| 104 | # |
| 105 | set r {} |
| 106 | for {set i 1} {$i<100} {incr i} { |
| 107 | lappend r testdb/index$i.tbl |
| 108 | } |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 109 | do_test index-3.2 { |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 110 | execsql {INSERT INTO test1 VALUES(1,2,3,4,5)} |
| 111 | lsort -dictionary [glob testdb/index*.tbl] |
| 112 | } $r |
| 113 | |
| 114 | # Verify that all the indices go away when we drop the table. |
| 115 | # |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 116 | do_test index-3.3 { |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 117 | execsql {DROP TABLE test1} |
| 118 | execsql {SELECT name FROM sqlite_master |
| 119 | WHERE type='index' AND tbl_name='test1' |
| 120 | ORDER BY name} |
| 121 | } {} |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 122 | do_test index-3.4 { |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 123 | lsort -dictionary [glob -nocomplain testdb/index*.tbl] |
| 124 | } {} |
| 125 | |
| 126 | # Create a table and insert values into that table. Then create |
| 127 | # an index on that table. Verify that we can select values |
| 128 | # from the table correctly using the index. |
| 129 | # |
drh | 7020f65 | 2000-06-03 18:06:52 +0000 | [diff] [blame] | 130 | # Note that the index names "index9" and "indext" are chosen because |
| 131 | # they both have the same hash. |
| 132 | # |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 133 | do_test index-4.1 { |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 134 | execsql {CREATE TABLE test1(cnt int, power int)} |
| 135 | for {set i 1} {$i<20} {incr i} { |
| 136 | execsql "INSERT INTO test1 VALUES($i,[expr {int(pow(2,$i))}])" |
| 137 | } |
drh | 7020f65 | 2000-06-03 18:06:52 +0000 | [diff] [blame] | 138 | execsql {CREATE INDEX index9 ON test1(cnt)} |
| 139 | execsql {CREATE INDEX indext ON test1(power)} |
drh | 2803757 | 2000-08-02 13:47:41 +0000 | [diff] [blame^] | 140 | execsql {SELECT name FROM sqlite_master WHERE type!='meta' ORDER BY name} |
drh | 7020f65 | 2000-06-03 18:06:52 +0000 | [diff] [blame] | 141 | } {index9 indext test1} |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 142 | do_test index-4.2 { |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 143 | execsql {SELECT cnt FROM test1 WHERE power=4} |
| 144 | } {2} |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 145 | do_test index-4.3 { |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 146 | execsql {SELECT cnt FROM test1 WHERE power=1024} |
| 147 | } {10} |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 148 | do_test index-4.4 { |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 149 | execsql {SELECT power FROM test1 WHERE cnt=6} |
| 150 | } {64} |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 151 | do_test index-4.5 { |
drh | 7020f65 | 2000-06-03 18:06:52 +0000 | [diff] [blame] | 152 | execsql {DROP INDEX indext} |
| 153 | execsql {SELECT power FROM test1 WHERE cnt=6} |
| 154 | } {64} |
| 155 | do_test index-4.6 { |
| 156 | execsql {SELECT cnt FROM test1 WHERE power=1024} |
| 157 | } {10} |
| 158 | do_test index-4.7 { |
| 159 | execsql {CREATE INDEX indext ON test1(cnt)} |
| 160 | execsql {SELECT power FROM test1 WHERE cnt=6} |
| 161 | } {64} |
| 162 | do_test index-4.8 { |
| 163 | execsql {SELECT cnt FROM test1 WHERE power=1024} |
| 164 | } {10} |
| 165 | do_test index-4.9 { |
| 166 | execsql {DROP INDEX index9} |
| 167 | execsql {SELECT power FROM test1 WHERE cnt=6} |
| 168 | } {64} |
| 169 | do_test index-4.10 { |
| 170 | execsql {SELECT cnt FROM test1 WHERE power=1024} |
| 171 | } {10} |
| 172 | do_test index-4.11 { |
| 173 | execsql {DROP INDEX indext} |
| 174 | execsql {SELECT power FROM test1 WHERE cnt=6} |
| 175 | } {64} |
| 176 | do_test index-4.12 { |
| 177 | execsql {SELECT cnt FROM test1 WHERE power=1024} |
| 178 | } {10} |
| 179 | do_test index-4.13 { |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 180 | execsql {DROP TABLE test1} |
drh | 2803757 | 2000-08-02 13:47:41 +0000 | [diff] [blame^] | 181 | execsql {SELECT name FROM sqlite_master WHERE type!='meta' ORDER BY name} |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 182 | } {} |
| 183 | |
| 184 | # Do not allow indices to be added to sqlite_master |
| 185 | # |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 186 | do_test index-5.1 { |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 187 | set v [catch {execsql {CREATE INDEX index1 ON sqlite_master(name)}} msg] |
| 188 | lappend v $msg |
| 189 | } {1 {table sqlite_master may not have new indices added}} |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 190 | do_test index-5.2 { |
drh | 2803757 | 2000-08-02 13:47:41 +0000 | [diff] [blame^] | 191 | execsql {SELECT name FROM sqlite_master WHERE type!='meta'} |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 192 | } {} |
| 193 | |
| 194 | # Do not allow indices with duplicate names to be added |
| 195 | # |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 196 | do_test index-6.1 { |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 197 | execsql {CREATE TABLE test1(f1 int, f2 int)} |
| 198 | execsql {CREATE TABLE test2(g1 real, g2 real)} |
| 199 | execsql {CREATE INDEX index1 ON test1(f1)} |
| 200 | set v [catch {execsql {CREATE INDEX index1 ON test2(g1)}} msg] |
| 201 | lappend v $msg |
drh | 1d37e28 | 2000-05-30 03:12:21 +0000 | [diff] [blame] | 202 | } {1 {index index1 already exists}} |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 203 | do_test index-6.1b { |
drh | 2803757 | 2000-08-02 13:47:41 +0000 | [diff] [blame^] | 204 | execsql {SELECT name FROM sqlite_master WHERE type!='meta' ORDER BY name} |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 205 | } {index1 test1 test2} |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 206 | do_test index-6.2 { |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 207 | set v [catch {execsql {CREATE INDEX test1 ON test2(g1)}} msg] |
| 208 | lappend v $msg |
drh | 1d37e28 | 2000-05-30 03:12:21 +0000 | [diff] [blame] | 209 | } {1 {there is already a table named test1}} |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 210 | do_test index-6.2b { |
drh | 2803757 | 2000-08-02 13:47:41 +0000 | [diff] [blame^] | 211 | execsql {SELECT name FROM sqlite_master WHERE type!='meta' ORDER BY name} |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 212 | } {index1 test1 test2} |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 213 | do_test index-6.3 { |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 214 | execsql {DROP TABLE test1} |
| 215 | execsql {DROP TABLE test2} |
drh | 2803757 | 2000-08-02 13:47:41 +0000 | [diff] [blame^] | 216 | execsql {SELECT name FROM sqlite_master WHERE type!='meta' ORDER BY name} |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 217 | } {} |
| 218 | |
| 219 | # Create a primary key |
| 220 | # |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 221 | do_test index-7.1 { |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 222 | execsql {CREATE TABLE test1(f1 int, f2 int primary key)} |
| 223 | for {set i 1} {$i<20} {incr i} { |
| 224 | execsql "INSERT INTO test1 VALUES($i,[expr {int(pow(2,$i))}])" |
| 225 | } |
| 226 | lsort -dictionary [glob testdb/test1*.tbl] |
| 227 | } {testdb/test1.tbl testdb/test1__primary_key.tbl} |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 228 | do_test index-7.2 { |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 229 | execsql {SELECT f1 FROM test1 WHERE f2=65536} |
| 230 | } {16} |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 231 | do_test index-7.3 { |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 232 | set code [execsql {EXPLAIN SELECT f1 FROM test1 WHERE f2=65536}] |
| 233 | expr {[lsearch $code test1__primary_key]>0} |
| 234 | } {1} |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 235 | do_test index-7.4 { |
| 236 | execsql {DROP table test1} |
drh | 2803757 | 2000-08-02 13:47:41 +0000 | [diff] [blame^] | 237 | execsql {SELECT name FROM sqlite_master WHERE type!='meta'} |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 238 | } {} |
| 239 | |
drh | 7020f65 | 2000-06-03 18:06:52 +0000 | [diff] [blame] | 240 | # Make sure we cannot drop a non-existant index. |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 241 | # |
| 242 | do_test index-8.1 { |
| 243 | set v [catch {execsql {DROP INDEX index1}} msg] |
| 244 | lappend v $msg |
drh | 1d37e28 | 2000-05-30 03:12:21 +0000 | [diff] [blame] | 245 | } {1 {no such index: index1}} |
drh | 1b6a71f | 2000-05-29 23:58:11 +0000 | [diff] [blame] | 246 | |
drh | 7020f65 | 2000-06-03 18:06:52 +0000 | [diff] [blame] | 247 | # Make sure we don't actually create an index when the EXPLAIN keyword |
| 248 | # is used. |
| 249 | # |
| 250 | do_test index-9.1 { |
| 251 | execsql {CREATE TABLE tab1(a int)} |
| 252 | execsql {EXPLAIN CREATE INDEX idx1 ON tab1(a)} |
| 253 | execsql {SELECT name FROM sqlite_master WHERE tbl_name='tab1'} |
| 254 | } {tab1} |
| 255 | do_test index-9.2 { |
| 256 | execsql {CREATE INDEX idx1 ON tab1(a)} |
| 257 | execsql {SELECT name FROM sqlite_master WHERE tbl_name='tab1' ORDER BY name} |
| 258 | } {idx1 tab1} |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 259 | |
drh | e840972 | 2000-06-08 16:54:40 +0000 | [diff] [blame] | 260 | # Allow more than one entry with the same key. |
| 261 | # |
| 262 | do_test index-10.0 { |
| 263 | execsql { |
| 264 | CREATE TABLE t1(a int, b int); |
| 265 | CREATE INDEX i1 ON t1(a); |
| 266 | INSERT INTO t1 VALUES(1,2); |
| 267 | INSERT INTO t1 VALUES(2,4); |
| 268 | INSERT INTO t1 VALUES(3,8); |
| 269 | INSERT INTO t1 VALUES(1,12); |
| 270 | SELECT b FROM t1 WHERE a=1 ORDER BY b; |
| 271 | } |
| 272 | } {2 12} |
| 273 | do_test index-10.1 { |
| 274 | execsql { |
| 275 | SELECT b FROM t1 WHERE a=2 ORDER BY b; |
| 276 | } |
| 277 | } {4} |
| 278 | do_test index-10.2 { |
| 279 | execsql { |
| 280 | DELETE FROM t1 WHERE b=12; |
| 281 | SELECT b FROM t1 WHERE a=1 ORDER BY b; |
| 282 | } |
| 283 | } {2} |
drh | 353f57e | 2000-08-02 12:26:28 +0000 | [diff] [blame] | 284 | do_test index-10.3 { |
drh | e840972 | 2000-06-08 16:54:40 +0000 | [diff] [blame] | 285 | execsql { |
| 286 | DELETE FROM t1 WHERE b=2; |
| 287 | SELECT b FROM t1 WHERE a=1 ORDER BY b; |
| 288 | } |
| 289 | } {} |
drh | 353f57e | 2000-08-02 12:26:28 +0000 | [diff] [blame] | 290 | do_test index-10.4 { |
| 291 | execsql { |
| 292 | DELETE FROM t1; |
| 293 | INSERT INTO t1 VALUES (1,1); |
| 294 | INSERT INTO t1 VALUES (1,2); |
| 295 | INSERT INTO t1 VALUES (1,3); |
| 296 | INSERT INTO t1 VALUES (1,4); |
| 297 | INSERT INTO t1 VALUES (1,5); |
| 298 | INSERT INTO t1 VALUES (1,6); |
| 299 | INSERT INTO t1 VALUES (1,7); |
| 300 | INSERT INTO t1 VALUES (1,8); |
| 301 | INSERT INTO t1 VALUES (1,9); |
| 302 | INSERT INTO t1 VALUES (2,0); |
| 303 | SELECT b FROM t1 WHERE a=1 ORDER BY b; |
| 304 | } |
| 305 | } {1 2 3 4 5 6 7 8 9} |
| 306 | do_test index-10.5 { |
| 307 | execsql { |
| 308 | DELETE FROM t1 WHERE b IN (2, 4, 6, 8); |
| 309 | SELECT b FROM t1 WHERE a=1 ORDER BY b; |
| 310 | } |
| 311 | } {1 3 5 7 9} |
| 312 | do_test index-10.6 { |
| 313 | execsql { |
| 314 | DELETE FROM t1 WHERE b>2; |
| 315 | SELECT b FROM t1 WHERE a=1 ORDER BY b; |
| 316 | } |
| 317 | } {1} |
| 318 | do_test index-10.7 { |
| 319 | execsql { |
| 320 | DELETE FROM t1 WHERE b=1; |
| 321 | SELECT b FROM t1 WHERE a=1 ORDER BY b; |
| 322 | } |
| 323 | } {} |
| 324 | do_test index-10.8 { |
| 325 | execsql { |
| 326 | SELECT b FROM t1 ORDER BY b; |
| 327 | } |
| 328 | } {0} |
| 329 | |
drh | e840972 | 2000-06-08 16:54:40 +0000 | [diff] [blame] | 330 | |
drh | b24fcbe | 2000-05-29 23:30:50 +0000 | [diff] [blame] | 331 | finish_test |