OLD | NEW |
1 # 2010 November 19 | 1 # 2010 November 19 |
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 #*********************************************************************** |
11 # | 11 # |
12 | 12 |
13 set testdir [file dirname $argv0] | 13 set testdir [file dirname $argv0] |
14 source $testdir/tester.tcl | 14 source $testdir/tester.tcl |
15 source $testdir/lock_common.tcl | 15 source $testdir/lock_common.tcl |
16 | 16 |
17 set testprefix superlock | 17 set testprefix superlock |
| 18 do_not_use_codec |
18 | 19 |
19 # Test organization: | 20 # Test organization: |
20 # | 21 # |
21 # 1.*: Test superlock on a rollback database. Test that once the db is | 22 # 1.*: Test superlock on a rollback database. Test that once the db is |
22 # superlocked, it is not possible for a second client to read from | 23 # superlocked, it is not possible for a second client to read from |
23 # it. | 24 # it. |
24 # | 25 # |
25 # 2.*: Test superlock on a WAL database with zero frames in the WAL file. | 26 # 2.*: Test superlock on a WAL database with zero frames in the WAL file. |
26 # Test that once the db is superlocked, it is not possible to read, | 27 # Test that once the db is superlocked, it is not possible to read, |
27 # write or checkpoint the db. | 28 # write or checkpoint the db. |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 do_execsql_test 6.6 { PRAGMA wal_checkpoint } {0 0 0} | 232 do_execsql_test 6.6 { PRAGMA wal_checkpoint } {0 0 0} |
232 | 233 |
233 db_swap test.db2 test.db | 234 db_swap test.db2 test.db |
234 do_catchsql_test 6.7 { SELECT * FROM t1 } {1 {no such table: t1}} | 235 do_catchsql_test 6.7 { SELECT * FROM t1 } {1 {no such table: t1}} |
235 do_catchsql_test 6.8 { SELECT * FROM t2 } {0 {a b}} | 236 do_catchsql_test 6.8 { SELECT * FROM t2 } {0 {a b}} |
236 | 237 |
237 db_swap test.db2 test.db | 238 db_swap test.db2 test.db |
238 do_catchsql_test 6.9 { SELECT * FROM t1 } {0 {1 2 3 4}} | 239 do_catchsql_test 6.9 { SELECT * FROM t1 } {0 {1 2 3 4}} |
239 do_catchsql_test 6.10 { SELECT * FROM t2 } {1 {no such table: t2}} | 240 do_catchsql_test 6.10 { SELECT * FROM t2 } {1 {no such table: t2}} |
240 | 241 |
241 do_execsql_test 6.11 { | 242 if {[nonzero_reserved_bytes]} { |
242 PRAGMA journal_mode = delete; | 243 # Vacuum with a size change is not allowed with the codec |
243 PRAGMA page_size = 512; | 244 do_execsql_test 6.11codec { |
244 VACUUM; | 245 PRAGMA journal_mode = delete; |
245 PRAGMA journal_mode = wal; | 246 VACUUM; |
246 INSERT INTO t1 VALUES(5, 6); | 247 PRAGMA journal_mode = wal; |
247 } {delete wal} | 248 INSERT INTO t1 VALUES(5, 6); |
| 249 } {delete wal} |
| 250 } else { |
| 251 do_execsql_test 6.11 { |
| 252 PRAGMA journal_mode = delete; |
| 253 PRAGMA page_size = 512; |
| 254 VACUUM; |
| 255 PRAGMA journal_mode = wal; |
| 256 INSERT INTO t1 VALUES(5, 6); |
| 257 } {delete wal} |
| 258 } |
248 | 259 |
249 db_swap test.db2 test.db | 260 db_swap test.db2 test.db |
250 do_catchsql_test 6.12 { SELECT * FROM t1 } {1 {no such table: t1}} | 261 do_catchsql_test 6.12 { SELECT * FROM t1 } {1 {no such table: t1}} |
251 do_catchsql_test 6.13 { SELECT * FROM t2 } {0 {a b}} | 262 do_catchsql_test 6.13 { SELECT * FROM t2 } {0 {a b}} |
252 | 263 |
253 db_swap test.db2 test.db | 264 db_swap test.db2 test.db |
254 do_catchsql_test 6.14 { SELECT * FROM t1 } {0 {1 2 3 4 5 6}} | 265 do_catchsql_test 6.14 { SELECT * FROM t1 } {0 {1 2 3 4 5 6}} |
255 do_catchsql_test 6.15 { SELECT * FROM t2 } {1 {no such table: t2}} | 266 do_catchsql_test 6.15 { SELECT * FROM t2 } {1 {no such table: t2}} |
256 | 267 |
257 finish_test | 268 finish_test |
OLD | NEW |