3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give.
10 #***********************************************************************
13 set testdir [file dirname $argv0]
14 source $testdir/tester.tcl
15 source $testdir/malloc_common.tcl
17 foreach f [glob -nocomplain test.db*mj*] { file delete -force $f }
18 file delete -force test.db2
20 do_test tkt-f3e5abed55-1.1 {
22 ATTACH 'test.db2' AS aux;
23 CREATE TABLE main.t1(a, b);
24 CREATE TABLE aux.t2(c, d);
28 do_test tkt-f3e5abed55-1.2 {
29 glob -nocomplain test.db*mj*
32 do_test tkt-f3e5abed55-1.3 {
34 execsql { BEGIN; SELECT * FROM t1 } db2
37 do_test tkt-f3e5abed55-1.4 {
40 INSERT INTO t1 VALUES(1, 2);
41 INSERT INTO t2 VALUES(1, 2);
44 } {1 {database is locked}}
46 do_test tkt-f3e5abed55-1.5 {
51 do_test tkt-f3e5abed55-1.6 {
52 glob -nocomplain test.db*mj*
54 foreach f [glob -nocomplain test.db*mj*] { file delete -force $f }
60 # Set up a testvfs so that the next time SQLite tries to delete the
61 # file "test.db-journal", a snapshot of the current file-system contents
64 # This test will not work with an in-memory journal.
66 if {[permutation]!="inmemory_journal"} {
67 testvfs tvfs -default 1
70 proc xDelete {method file args} {
71 if {[file tail $file] == "test.db-journal"} {
80 do_test tkt-f3e5abed55-2.1 {
82 ATTACH 'test.db2' AS aux;
84 INSERT INTO t1 VALUES(3, 4);
85 INSERT INTO t2 VALUES(3, 4);
88 do_test tkt-f3e5abed55-2.2 {
89 execsql { BEGIN; SELECT * FROM t1 } db2
91 do_test tkt-f3e5abed55-2.3 {
93 } {1 {database is locked}}
95 do_test tkt-f3e5abed55-2.4 {
103 do_test tkt-f3e5abed55-2.5 {
106 faultsim_restore_and_reopen
108 ATTACH 'test.db2' AS aux;