OLD | NEW |
1 # 2009 April 20 | 1 # 2009 April 20 |
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 30 matching lines...) Expand all Loading... |
41 do_test jrnlmode3-1.2 { | 41 do_test jrnlmode3-1.2 { |
42 db eval { | 42 db eval { |
43 BEGIN; | 43 BEGIN; |
44 INSERT INTO t1 VALUES(2); | 44 INSERT INTO t1 VALUES(2); |
45 ROLLBACK; | 45 ROLLBACK; |
46 SELECT * FROM t1; | 46 SELECT * FROM t1; |
47 } | 47 } |
48 } {1} | 48 } {1} |
49 | 49 |
50 db close | 50 db close |
51 file delete -force test.db test.db-journal | 51 forcedelete test.db test.db-journal |
52 sqlite3 db test.db | 52 sqlite3 db test.db |
53 | 53 |
54 do_test jrnlmode3-2.1 { | 54 do_test jrnlmode3-2.1 { |
55 db eval { | 55 db eval { |
56 PRAGMA locking_mode=EXCLUSIVE; | 56 PRAGMA locking_mode=EXCLUSIVE; |
57 PRAGMA journal_mode=OFF; | 57 PRAGMA journal_mode=OFF; |
58 CREATE TABLE t1(x); | 58 CREATE TABLE t1(x); |
59 INSERT INTO t1 VALUES(1); | 59 INSERT INTO t1 VALUES(1); |
60 SELECT * FROM t1; | 60 SELECT * FROM t1; |
61 } | 61 } |
(...skipping 16 matching lines...) Expand all Loading... |
78 foreach fromjmode $all_journal_modes { | 78 foreach fromjmode $all_journal_modes { |
79 foreach tojmode $all_journal_modes { | 79 foreach tojmode $all_journal_modes { |
80 | 80 |
81 # Skip the no-change cases | 81 # Skip the no-change cases |
82 if {$fromjmode==$tojmode} continue | 82 if {$fromjmode==$tojmode} continue |
83 incr cnt | 83 incr cnt |
84 | 84 |
85 # Start with a fresh database connection an empty database file. | 85 # Start with a fresh database connection an empty database file. |
86 # | 86 # |
87 db close | 87 db close |
88 file delete -force test.db test.db-journal | 88 forcedelete test.db test.db-journal |
89 sqlite3 db test.db | 89 sqlite3 db test.db |
90 | 90 |
91 # Initialize the journal mode. | 91 # Initialize the journal mode. |
92 # | 92 # |
93 do_test jrnlmode3-3.$cnt.1-($fromjmode-to-$tojmode) { | 93 do_test jrnlmode3-3.$cnt.1-($fromjmode-to-$tojmode) { |
94 db eval "PRAGMA journal_mode = $fromjmode;" | 94 db eval "PRAGMA journal_mode = $fromjmode;" |
95 } $fromjmode | 95 } $fromjmode |
96 | 96 |
97 # Verify that the initial journal mode takes. | 97 # Verify that the initial journal mode takes. |
98 # | 98 # |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 } | 140 } |
141 db eval ROLLBACK | 141 db eval ROLLBACK |
142 db eval { | 142 db eval { |
143 SELECT * FROM t1; | 143 SELECT * FROM t1; |
144 } | 144 } |
145 } {} | 145 } {} |
146 } | 146 } |
147 } | 147 } |
148 | 148 |
149 finish_test | 149 finish_test |
OLD | NEW |