| OLD | NEW |
| 1 # 2005 December 21 | 1 # 2005 December 21 |
| 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 SELECT count(*) FROM t2; | 190 SELECT count(*) FROM t2; |
| 191 } | 191 } |
| 192 } {9} | 192 } {9} |
| 193 do_test descidx1-4.2 { | 193 do_test descidx1-4.2 { |
| 194 execsql { | 194 execsql { |
| 195 SELECT d FROM t2 ORDER BY a; | 195 SELECT d FROM t2 ORDER BY a; |
| 196 } | 196 } |
| 197 } {1.0 2.2 2.0 2.1 2.3 3.0 4.0 5.0 6.0} | 197 } {1.0 2.2 2.0 2.1 2.3 3.0 4.0 5.0 6.0} |
| 198 do_test descidx1-4.3 { | 198 do_test descidx1-4.3 { |
| 199 execsql { | 199 execsql { |
| 200 SELECT d FROM t2 WHERE a>=2; | 200 SELECT d FROM t2 WHERE a>=2 ORDER BY a; |
| 201 } | 201 } |
| 202 } {2.2 2.0 2.1 2.3 3.0 4.0 5.0 6.0} | 202 } {2.2 2.0 2.1 2.3 3.0 4.0 5.0 6.0} |
| 203 do_test descidx1-4.4 { | 203 do_test descidx1-4.4 { |
| 204 execsql { | 204 execsql { |
| 205 SELECT d FROM t2 WHERE a>2; | 205 SELECT d FROM t2 WHERE a>2 ORDER BY a; |
| 206 } | 206 } |
| 207 } {3.0 4.0 5.0 6.0} | 207 } {3.0 4.0 5.0 6.0} |
| 208 do_test descidx1-4.5 { | 208 do_test descidx1-4.5 { |
| 209 execsql { | 209 execsql { |
| 210 SELECT d FROM t2 WHERE a=2 AND b>'two'; | 210 SELECT d FROM t2 WHERE a=2 AND b>'two'; |
| 211 } | 211 } |
| 212 } {2.2} | 212 } {2.2} |
| 213 do_test descidx1-4.6 { | 213 do_test descidx1-4.6 { |
| 214 execsql { | 214 execsql { |
| 215 SELECT d FROM t2 WHERE a=2 AND b>='two'; | 215 SELECT d FROM t2 WHERE a=2 AND b>='two'; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 SELECT a||b||c FROM t3 WHERE d=0 ORDER BY a DESC, b DESC, c ASC | 290 SELECT a||b||c FROM t3 WHERE d=0 ORDER BY a DESC, b DESC, c ASC |
| 291 } | 291 } |
| 292 } {110 111 100 101 010 011 000 001 sort} | 292 } {110 111 100 101 010 011 000 001 sort} |
| 293 | 293 |
| 294 # Test the legacy_file_format pragma here because we have access to | 294 # Test the legacy_file_format pragma here because we have access to |
| 295 # the get_file_format command. | 295 # the get_file_format command. |
| 296 # | 296 # |
| 297 ifcapable legacyformat { | 297 ifcapable legacyformat { |
| 298 do_test descidx1-6.1 { | 298 do_test descidx1-6.1 { |
| 299 db close | 299 db close |
| 300 file delete -force test.db test.db-journal | 300 forcedelete test.db test.db-journal |
| 301 sqlite3 db test.db | 301 sqlite3 db test.db |
| 302 execsql {PRAGMA legacy_file_format} | 302 execsql {PRAGMA legacy_file_format} |
| 303 } {1} | 303 } {1} |
| 304 } else { | 304 } else { |
| 305 do_test descidx1-6.1 { | 305 do_test descidx1-6.1 { |
| 306 db close | 306 db close |
| 307 file delete -force test.db test.db-journal | 307 forcedelete test.db test.db-journal |
| 308 sqlite3 db test.db | 308 sqlite3 db test.db |
| 309 execsql {PRAGMA legacy_file_format} | 309 execsql {PRAGMA legacy_file_format} |
| 310 } {0} | 310 } {0} |
| 311 } | 311 } |
| 312 do_test descidx1-6.2 { | 312 do_test descidx1-6.2 { |
| 313 execsql {PRAGMA legacy_file_format=YES} | 313 execsql {PRAGMA legacy_file_format=YES} |
| 314 execsql {PRAGMA legacy_file_format} | 314 execsql {PRAGMA legacy_file_format} |
| 315 } {1} | 315 } {1} |
| 316 do_test descidx1-6.3 { | 316 do_test descidx1-6.3 { |
| 317 execsql { | 317 execsql { |
| 318 CREATE TABLE t1(a,b,c); | 318 CREATE TABLE t1(a,b,c); |
| 319 } | 319 } |
| 320 get_file_format | 320 get_file_format |
| 321 } {1} | 321 } {1} |
| 322 ifcapable vacuum { | 322 ifcapable vacuum { |
| 323 # Verify that the file format is preserved across a vacuum. | 323 # Verify that the file format is preserved across a vacuum. |
| 324 do_test descidx1-6.3.1 { | 324 do_test descidx1-6.3.1 { |
| 325 execsql {VACUUM} | 325 execsql {VACUUM} |
| 326 get_file_format | 326 get_file_format |
| 327 } {1} | 327 } {1} |
| 328 } | 328 } |
| 329 do_test descidx1-6.4 { | 329 do_test descidx1-6.4 { |
| 330 db close | 330 db close |
| 331 file delete -force test.db test.db-journal | 331 forcedelete test.db test.db-journal |
| 332 sqlite3 db test.db | 332 sqlite3 db test.db |
| 333 execsql {PRAGMA legacy_file_format=NO} | 333 execsql {PRAGMA legacy_file_format=NO} |
| 334 execsql {PRAGMA legacy_file_format} | 334 execsql {PRAGMA legacy_file_format} |
| 335 } {0} | 335 } {0} |
| 336 do_test descidx1-6.5 { | 336 do_test descidx1-6.5 { |
| 337 execsql { | 337 execsql { |
| 338 CREATE TABLE t1(a,b,c); | 338 CREATE TABLE t1(a,b,c); |
| 339 CREATE INDEX i1 ON t1(a ASC, b DESC, c ASC); | 339 CREATE INDEX i1 ON t1(a ASC, b DESC, c ASC); |
| 340 INSERT INTO t1 VALUES(1,2,3); | 340 INSERT INTO t1 VALUES(1,2,3); |
| 341 INSERT INTO t1 VALUES(1,1,0); | 341 INSERT INTO t1 VALUES(1,1,0); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 355 PRAGMA legacy_file_format=ON; | 355 PRAGMA legacy_file_format=ON; |
| 356 VACUUM; | 356 VACUUM; |
| 357 } | 357 } |
| 358 get_file_format | 358 get_file_format |
| 359 } {4} | 359 } {4} |
| 360 } | 360 } |
| 361 | 361 |
| 362 | 362 |
| 363 | 363 |
| 364 finish_test | 364 finish_test |
| OLD | NEW |