OLD | NEW |
1 # 2003 July 1 | 1 # 2003 July 1 |
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 17 matching lines...) Expand all Loading... |
28 # recursive triggers for this file. | 28 # recursive triggers for this file. |
29 catchsql { pragma recursive_triggers = off } | 29 catchsql { pragma recursive_triggers = off } |
30 | 30 |
31 # Create tables t1 and t2 in the main database | 31 # Create tables t1 and t2 in the main database |
32 execsql { | 32 execsql { |
33 CREATE TABLE t1(a, b); | 33 CREATE TABLE t1(a, b); |
34 CREATE TABLE t2(c, d); | 34 CREATE TABLE t2(c, d); |
35 } | 35 } |
36 | 36 |
37 # Create tables t1 and t2 in database file test2.db | 37 # Create tables t1 and t2 in database file test2.db |
38 file delete -force test2.db | 38 forcedelete test2.db |
39 file delete -force test2.db-journal | 39 forcedelete test2.db-journal |
40 sqlite3 db2 test2.db | 40 sqlite3 db2 test2.db |
41 execsql { | 41 execsql { |
42 CREATE TABLE t1(a, b); | 42 CREATE TABLE t1(a, b); |
43 CREATE TABLE t2(c, d); | 43 CREATE TABLE t2(c, d); |
44 } db2 | 44 } db2 |
45 db2 close | 45 db2 close |
46 | 46 |
47 # Create a table in the auxilary database. | 47 # Create a table in the auxilary database. |
48 do_test attach3-1.1 { | 48 do_test attach3-1.1 { |
49 execsql { | 49 execsql { |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 } | 315 } |
316 db_list | 316 db_list |
317 } {main temp} | 317 } {main temp} |
318 do_test attach3-12.9 { | 318 do_test attach3-12.9 { |
319 execsql { | 319 execsql { |
320 ATTACH DATABASE '' AS NULL | 320 ATTACH DATABASE '' AS NULL |
321 } | 321 } |
322 db_list | 322 db_list |
323 } {main temp {}} | 323 } {main temp {}} |
324 do_test attach3-12.10 { | 324 do_test attach3-12.10 { |
325 breakpoint | |
326 execsql { | 325 execsql { |
327 DETACH ? | 326 DETACH ? |
328 } | 327 } |
329 db_list | 328 db_list |
330 } {main temp} | 329 } {main temp} |
331 do_test attach3-12.11 { | 330 do_test attach3-12.11 { |
332 catchsql { | 331 catchsql { |
333 DETACH NULL | 332 DETACH NULL |
334 } | 333 } |
335 } {1 {no such database: }} | 334 } {1 {no such database: }} |
336 do_test attach3-12.12 { | 335 do_test attach3-12.12 { |
337 catchsql { | 336 catchsql { |
338 ATTACH null AS null; | 337 ATTACH null AS null; |
339 ATTACH '' AS ''; | 338 ATTACH '' AS ''; |
340 } | 339 } |
341 } {1 {database is already in use}} | 340 } {1 {database is already in use}} |
342 do_test attach3-12.13 { | 341 do_test attach3-12.13 { |
343 db_list | 342 db_list |
344 } {main temp {}} | 343 } {main temp {}} |
345 do_test attach3-12.14 { | 344 do_test attach3-12.14 { |
346 execsql { | 345 execsql { |
347 DETACH ''; | 346 DETACH ''; |
348 } | 347 } |
349 db_list | 348 db_list |
350 } {main temp} | 349 } {main temp} |
351 | 350 |
352 } ;# ifcapable pragma | 351 } ;# ifcapable pragma |
353 | 352 |
354 finish_test | 353 finish_test |
OLD | NEW |