Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Changes to wal tests so that they work with DEFAULT_AUTOVACUUM defined. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
b477852f82c1fddbda61fad83d55055a |
User & Date: | dan 2011-04-01 19:14:40.912 |
Context
2011-04-01
| ||
20:47 | Merge the word-fuzzer branch into trunk. (check-in: f77609d441 user: drh tags: trunk) | |
19:14 | Changes to wal tests so that they work with DEFAULT_AUTOVACUUM defined. (check-in: b477852f82 user: dan tags: trunk) | |
18:39 | Merge the multiplexer enhancements back into the trunk. (check-in: 2c125710cb user: drh tags: trunk) | |
Changes
Changes to test/wal.test.
︙ | ︙ | |||
459 460 461 462 463 464 465 466 467 468 469 470 471 472 | # do_multiclient_test tn { # Initialize the database schema and contents. # do_test wal-10.$tn.1 { execsql { PRAGMA journal_mode = wal; CREATE TABLE t1(a, b); INSERT INTO t1 VALUES(1, 2); SELECT * FROM t1; } } {wal 1 2} | > | 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 | # do_multiclient_test tn { # Initialize the database schema and contents. # do_test wal-10.$tn.1 { execsql { PRAGMA auto_vacuum = 0; PRAGMA journal_mode = wal; CREATE TABLE t1(a, b); INSERT INTO t1 VALUES(1, 2); SELECT * FROM t1; } } {wal 1 2} |
︙ | ︙ |
Changes to test/wal2.test.
︙ | ︙ | |||
339 340 341 342 343 344 345 346 347 348 349 350 351 352 | #------------------------------------------------------------------------- # Test that a database connection using a VFS that does not support the # xShmXXX interfaces cannot open a WAL database. # do_test wal2-4.1 { sqlite3 db test.db execsql { PRAGMA journal_mode = WAL; CREATE TABLE data(x); INSERT INTO data VALUES('need xShmOpen to see this'); PRAGMA wal_checkpoint; } } {wal 0 5 5} do_test wal2-4.2 { | > | 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 | #------------------------------------------------------------------------- # Test that a database connection using a VFS that does not support the # xShmXXX interfaces cannot open a WAL database. # do_test wal2-4.1 { sqlite3 db test.db execsql { PRAGMA auto_vacuum = 0; PRAGMA journal_mode = WAL; CREATE TABLE data(x); INSERT INTO data VALUES('need xShmOpen to see this'); PRAGMA wal_checkpoint; } } {wal 0 5 5} do_test wal2-4.2 { |
︙ | ︙ | |||
618 619 620 621 622 623 624 625 626 627 628 629 630 631 | {4 1 lock shared} {0 1 lock exclusive} {0 1 unlock exclusive} {4 1 unlock shared} } foreach {tn sql res expected_locks} { 2 { PRAGMA journal_mode = WAL; BEGIN; CREATE TABLE t1(x); INSERT INTO t1 VALUES('Leonard'); INSERT INTO t1 VALUES('Arthur'); COMMIT; } {wal} { | > | 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 | {4 1 lock shared} {0 1 lock exclusive} {0 1 unlock exclusive} {4 1 unlock shared} } foreach {tn sql res expected_locks} { 2 { PRAGMA auto_vacuum = 0; PRAGMA journal_mode = WAL; BEGIN; CREATE TABLE t1(x); INSERT INTO t1 VALUES('Leonard'); INSERT INTO t1 VALUES('Arthur'); COMMIT; } {wal} { |
︙ | ︙ | |||
703 704 705 706 707 708 709 710 711 712 713 714 715 716 | db close tvfs delete do_test wal2-6.5.1 { sqlite3 db test.db execsql { PRAGMA journal_mode = wal; PRAGMA locking_mode = exclusive; CREATE TABLE t2(a, b); PRAGMA wal_checkpoint; INSERT INTO t2 VALUES('I', 'II'); PRAGMA journal_mode; } | > | 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 | db close tvfs delete do_test wal2-6.5.1 { sqlite3 db test.db execsql { PRAGMA auto_vacuum = 0; PRAGMA journal_mode = wal; PRAGMA locking_mode = exclusive; CREATE TABLE t2(a, b); PRAGMA wal_checkpoint; INSERT INTO t2 VALUES('I', 'II'); PRAGMA journal_mode; } |
︙ | ︙ | |||
1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 | foreach {tn sql reslist} { 1 { } {8 0 3 0 5 0} 2 { PRAGMA checkpoint_fullfsync = 1 } {8 4 3 2 5 2} 3 { PRAGMA checkpoint_fullfsync = 0 } {8 0 3 0 5 0} } { faultsim_delete_and_reopen execsql $sql do_execsql_test wal2-14.$tn.1 { PRAGMA journal_mode = WAL } {wal} set sqlite_sync_count 0 set sqlite_fullsync_count 0 do_execsql_test wal2-14.$tn.2 { | > | 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 | foreach {tn sql reslist} { 1 { } {8 0 3 0 5 0} 2 { PRAGMA checkpoint_fullfsync = 1 } {8 4 3 2 5 2} 3 { PRAGMA checkpoint_fullfsync = 0 } {8 0 3 0 5 0} } { faultsim_delete_and_reopen execsql {PRAGMA auto_vacuum = 0} execsql $sql do_execsql_test wal2-14.$tn.1 { PRAGMA journal_mode = WAL } {wal} set sqlite_sync_count 0 set sqlite_fullsync_count 0 do_execsql_test wal2-14.$tn.2 { |
︙ | ︙ |
Changes to test/wal3.test.
︙ | ︙ | |||
409 410 411 412 413 414 415 416 417 418 419 420 421 422 | # obtain a different read-lock. # catch {db close} testvfs T -default 1 do_test wal3-6.1.1 { file delete -force test.db test.db-journal test.db wal sqlite3 db test.db execsql { PRAGMA journal_mode = WAL } execsql { CREATE TABLE t1(a, b); INSERT INTO t1 VALUES('o', 't'); INSERT INTO t1 VALUES('t', 'f'); } } {} | > | 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 | # obtain a different read-lock. # catch {db close} testvfs T -default 1 do_test wal3-6.1.1 { file delete -force test.db test.db-journal test.db wal sqlite3 db test.db execsql { PRAGMA auto_vacuum = off } execsql { PRAGMA journal_mode = WAL } execsql { CREATE TABLE t1(a, b); INSERT INTO t1 VALUES('o', 't'); INSERT INTO t1 VALUES('t', 'f'); } } {} |
︙ | ︙ | |||
490 491 492 493 494 495 496 497 498 499 500 501 502 503 | db2 close db close do_test wal3-6.2.1 { file delete -force test.db test.db-journal test.db wal sqlite3 db test.db sqlite3 db2 test.db execsql { PRAGMA journal_mode = WAL } execsql { CREATE TABLE t1(a, b); INSERT INTO t1 VALUES('h', 'h'); INSERT INTO t1 VALUES('l', 'b'); } } {} | > | 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 | db2 close db close do_test wal3-6.2.1 { file delete -force test.db test.db-journal test.db wal sqlite3 db test.db sqlite3 db2 test.db execsql { PRAGMA auto_vacuum = off } execsql { PRAGMA journal_mode = WAL } execsql { CREATE TABLE t1(a, b); INSERT INTO t1 VALUES('h', 'h'); INSERT INTO t1 VALUES('l', 'b'); } } {} |
︙ | ︙ | |||
613 614 615 616 617 618 619 620 621 622 623 624 625 626 | #------------------------------------------------------------------------- # do_test wal3-8.1 { file delete -force test.db test.db-journal test.db wal sqlite3 db test.db sqlite3 db2 test.db execsql { PRAGMA journal_mode = WAL; CREATE TABLE b(c); INSERT INTO b VALUES('Tehran'); INSERT INTO b VALUES('Qom'); INSERT INTO b VALUES('Markazi'); PRAGMA wal_checkpoint; } | > | 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 | #------------------------------------------------------------------------- # do_test wal3-8.1 { file delete -force test.db test.db-journal test.db wal sqlite3 db test.db sqlite3 db2 test.db execsql { PRAGMA auto_vacuum = off; PRAGMA journal_mode = WAL; CREATE TABLE b(c); INSERT INTO b VALUES('Tehran'); INSERT INTO b VALUES('Qom'); INSERT INTO b VALUES('Markazi'); PRAGMA wal_checkpoint; } |
︙ | ︙ |
Changes to test/wal5.test.
︙ | ︙ | |||
165 166 167 168 169 170 171 172 173 174 175 176 177 178 | # database file. # proc setup_and_attach_aux {} { sql1 { ATTACH 'test.db2' AS aux } sql2 { ATTACH 'test.db2' AS aux } sql3 { ATTACH 'test.db2' AS aux } sql1 { PRAGMA main.page_size=1024; PRAGMA main.journal_mode=WAL; PRAGMA aux.page_size=1024; PRAGMA aux.journal_mode=WAL; } } proc file_page_counts {} { list [db_page_count test.db ] \ | > > | 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | # database file. # proc setup_and_attach_aux {} { sql1 { ATTACH 'test.db2' AS aux } sql2 { ATTACH 'test.db2' AS aux } sql3 { ATTACH 'test.db2' AS aux } sql1 { PRAGMA aux.auto_vacuum = 0; PRAGMA main.auto_vacuum = 0; PRAGMA main.page_size=1024; PRAGMA main.journal_mode=WAL; PRAGMA aux.page_size=1024; PRAGMA aux.journal_mode=WAL; } } proc file_page_counts {} { list [db_page_count test.db ] \ |
︙ | ︙ | |||
305 306 307 308 309 310 311 312 313 314 315 316 317 318 | code1 $do_wal_checkpoint code2 $do_wal_checkpoint code3 $do_wal_checkpoint do_test 3.$tn.1 { sql1 { PRAGMA journal_mode = WAL; PRAGMA synchronous = normal; CREATE TABLE t1(x, y); } sql2 { PRAGMA journal_mode } sql3 { PRAGMA journal_mode } | > | 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 | code1 $do_wal_checkpoint code2 $do_wal_checkpoint code3 $do_wal_checkpoint do_test 3.$tn.1 { sql1 { PRAGMA auto_vacuum = 0; PRAGMA journal_mode = WAL; PRAGMA synchronous = normal; CREATE TABLE t1(x, y); } sql2 { PRAGMA journal_mode } sql3 { PRAGMA journal_mode } |
︙ | ︙ |