OLD | NEW |
1 # 2008 April 17 | 1 # 2008 April 17 |
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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 do_test jrnlmode-1.99 { | 193 do_test jrnlmode-1.99 { |
194 execsql { | 194 execsql { |
195 DETACH aux1; | 195 DETACH aux1; |
196 DETACH aux2; | 196 DETACH aux2; |
197 DETACH aux3; | 197 DETACH aux3; |
198 } | 198 } |
199 } {} | 199 } {} |
200 } | 200 } |
201 | 201 |
202 ifcapable attach { | 202 ifcapable attach { |
203 file delete -force test2.db | 203 forcedelete test2.db |
204 do_test jrnlmode-2.1 { | 204 do_test jrnlmode-2.1 { |
205 execsql { | 205 execsql { |
206 ATTACH 'test2.db' AS aux; | 206 ATTACH 'test2.db' AS aux; |
207 PRAGMA main.journal_mode = persist; | 207 PRAGMA main.journal_mode = persist; |
208 PRAGMA aux.journal_mode = persist; | 208 PRAGMA aux.journal_mode = persist; |
209 CREATE TABLE abc(a, b, c); | 209 CREATE TABLE abc(a, b, c); |
210 CREATE TABLE aux.def(d, e, f); | 210 CREATE TABLE aux.def(d, e, f); |
211 } | 211 } |
212 execsql { | 212 execsql { |
213 BEGIN; | 213 BEGIN; |
(...skipping 21 matching lines...) Expand all Loading... |
235 do_test jrnlmode-2.5 { | 235 do_test jrnlmode-2.5 { |
236 execsql { | 236 execsql { |
237 SELECT * FROM def; | 237 SELECT * FROM def; |
238 } | 238 } |
239 } {4 5 6} | 239 } {4 5 6} |
240 | 240 |
241 #---------------------------------------------------------------------- | 241 #---------------------------------------------------------------------- |
242 # Test caes jrnlmode-3.X verify that ticket #3127 has been fixed. | 242 # Test caes jrnlmode-3.X verify that ticket #3127 has been fixed. |
243 # | 243 # |
244 db close | 244 db close |
245 file delete -force test2.db | 245 forcedelete test2.db |
246 file delete -force test.db | 246 forcedelete test.db |
247 sqlite3 db test.db | 247 sqlite3 db test.db |
248 | 248 |
249 do_test jrnlmode-3.1 { | 249 do_test jrnlmode-3.1 { |
250 execsql { | 250 execsql { |
251 CREATE TABLE x(n INTEGER); | 251 CREATE TABLE x(n INTEGER); |
252 ATTACH 'test2.db' AS a; | 252 ATTACH 'test2.db' AS a; |
253 create table a.x ( n integer ); | 253 create table a.x ( n integer ); |
254 insert into a.x values(1); | 254 insert into a.x values(1); |
255 insert into a.x values (2); | 255 insert into a.x values (2); |
256 insert into a.x values (3); | 256 insert into a.x values (3); |
257 insert into a.x values (4); | 257 insert into a.x values (4); |
258 } | 258 } |
259 } {} | 259 } {} |
260 | 260 |
261 do_test jrnlmode-3.2 { | 261 do_test jrnlmode-3.2 { |
262 execsql { PRAGMA journal_mode=off; } | 262 execsql { PRAGMA journal_mode=off; } |
263 execsql { | 263 execsql { |
264 BEGIN IMMEDIATE; | 264 BEGIN IMMEDIATE; |
265 INSERT OR IGNORE INTO main.x SELECT * FROM a.x; | 265 INSERT OR IGNORE INTO main.x SELECT * FROM a.x; |
266 COMMIT; | 266 COMMIT; |
267 } | 267 } |
268 } {} | 268 } {} |
269 } | 269 } |
270 | 270 |
271 ifcapable autovacuum&&pragma { | 271 ifcapable autovacuum&&pragma { |
272 db close | 272 db close |
273 file delete -force test.db | 273 forcedelete test.db |
274 sqlite3 db test.db | 274 sqlite3 db test.db |
275 do_test jrnlmode-4.1 { | 275 do_test jrnlmode-4.1 { |
276 execsql { | 276 execsql { |
277 PRAGMA cache_size = 1; | 277 PRAGMA cache_size = 1; |
278 PRAGMA auto_vacuum = 1; | 278 PRAGMA auto_vacuum = 1; |
279 CREATE TABLE abc(a, b, c); | 279 CREATE TABLE abc(a, b, c); |
280 } | 280 } |
281 execsql { PRAGMA page_count } | 281 execsql { PRAGMA page_count } |
282 } {3} | 282 } {3} |
283 | 283 |
(...skipping 12 matching lines...) Expand all Loading... |
296 } {} | 296 } {} |
297 | 297 |
298 integrity_check jrnlmode-4.5 | 298 integrity_check jrnlmode-4.5 |
299 } | 299 } |
300 | 300 |
301 #------------------------------------------------------------------------ | 301 #------------------------------------------------------------------------ |
302 # The following test caes, jrnlmode-5.*, test the journal_size_limit | 302 # The following test caes, jrnlmode-5.*, test the journal_size_limit |
303 # pragma. | 303 # pragma. |
304 ifcapable pragma { | 304 ifcapable pragma { |
305 db close | 305 db close |
306 file delete -force test.db test2.db test3.db | 306 forcedelete test.db test2.db test3.db |
307 sqlite3 db test.db | 307 sqlite3 db test.db |
308 | 308 |
309 do_test jrnlmode-5.1 { | 309 do_test jrnlmode-5.1 { |
310 execsql {pragma page_size=1024} | 310 execsql {pragma page_size=1024} |
311 execsql {pragma journal_mode=persist} | 311 execsql {pragma journal_mode=persist} |
312 } {persist} | 312 } {persist} |
313 | 313 |
314 do_test jrnlmode-5.2 { | 314 do_test jrnlmode-5.2 { |
315 execsql { PRAGMA journal_size_limit } | 315 execsql { PRAGMA journal_size_limit } |
316 } {-1} | 316 } {-1} |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 BEGIN IMMEDIATE; INSERT INTO t4 VALUES(1,2); COMMIT; | 504 BEGIN IMMEDIATE; INSERT INTO t4 VALUES(1,2); COMMIT; |
505 } | 505 } |
506 file exists test.db-journal | 506 file exists test.db-journal |
507 } {0} | 507 } {0} |
508 } | 508 } |
509 } | 509 } |
510 | 510 |
511 ifcapable pragma { | 511 ifcapable pragma { |
512 catch { db close } | 512 catch { db close } |
513 do_test jrnlmode-7.1 { | 513 do_test jrnlmode-7.1 { |
514 foreach f [glob -nocomplain test.db*] { file delete -force $f } | 514 foreach f [glob -nocomplain test.db*] { forcedelete $f } |
515 sqlite3 db test.db | 515 sqlite3 db test.db |
516 execsql { | 516 execsql { |
517 PRAGMA journal_mode = memory; | 517 PRAGMA journal_mode = memory; |
518 PRAGMA auto_vacuum = 0; | 518 PRAGMA auto_vacuum = 0; |
519 PRAGMA page_size = 1024; | 519 PRAGMA page_size = 1024; |
520 PRAGMA user_version = 5; | 520 PRAGMA user_version = 5; |
521 PRAGMA user_version; | 521 PRAGMA user_version; |
522 } | 522 } |
523 } {memory 5} | 523 } {memory 5} |
524 do_test jrnlmode-7.2 { file size test.db } {1024} | 524 do_test jrnlmode-7.2 { file size test.db } {1024} |
(...skipping 24 matching lines...) Expand all Loading... |
549 do_execsql_test jrnlmode-8.23 { PRAGMA journal_mode=DELETE } {delete} | 549 do_execsql_test jrnlmode-8.23 { PRAGMA journal_mode=DELETE } {delete} |
550 do_execsql_test jrnlmode-8.24 { PRAGMA journal_mode=TRUNCATE } {truncate} | 550 do_execsql_test jrnlmode-8.24 { PRAGMA journal_mode=TRUNCATE } {truncate} |
551 do_execsql_test jrnlmode-8.25 { PRAGMA locking_mode=NORMAL } {normal} | 551 do_execsql_test jrnlmode-8.25 { PRAGMA locking_mode=NORMAL } {normal} |
552 do_execsql_test jrnlmode-8.26 { CREATE TABLE t4(w) } {} | 552 do_execsql_test jrnlmode-8.26 { CREATE TABLE t4(w) } {} |
553 do_execsql_test jrnlmode-8.27 { BEGIN IMMEDIATE } {} | 553 do_execsql_test jrnlmode-8.27 { BEGIN IMMEDIATE } {} |
554 do_execsql_test jrnlmode-8.28 { PRAGMA journal_mode=DELETE } {delete} | 554 do_execsql_test jrnlmode-8.28 { PRAGMA journal_mode=DELETE } {delete} |
555 do_execsql_test jrnlmode-8.29 { COMMIT } {} | 555 do_execsql_test jrnlmode-8.29 { COMMIT } {} |
556 do_execsql_test jrnlmode-8.30 { PRAGMA journal_mode=DELETE } {delete} | 556 do_execsql_test jrnlmode-8.30 { PRAGMA journal_mode=DELETE } {delete} |
557 | 557 |
558 finish_test | 558 finish_test |
OLD | NEW |