Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Add further tests for wal2 mode. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | wal2 |
Files: | files | file ages | folders |
SHA3-256: |
54e628f902a5508badc8941ceda1bec1 |
User & Date: | dan 2018-12-14 19:53:39.654 |
Context
2018-12-15
| ||
20:20 | Further test cases for wal2 mode. (check-in: 9cb5f8dab6 user: dan tags: wal2) | |
2018-12-14
| ||
19:53 | Add further tests for wal2 mode. (check-in: 54e628f902 user: dan tags: wal2) | |
2018-12-13
| ||
16:26 | Add tests cases for recovery in wal2 mode. (check-in: 34f56f8a42 user: dan tags: wal2) | |
Changes
Changes to src/wal.c.
︙ | ︙ | |||
1528 1529 1530 1531 1532 1533 1534 | testcase( szPage>=65536 ); aFrameCksum[0] = pWal->hdr.aFrameCksum[0]; aFrameCksum[1] = pWal->hdr.aFrameCksum[1]; } } sqlite3_free(aFrame); | | | 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 | testcase( szPage>=65536 ); aFrameCksum[0] = pWal->hdr.aFrameCksum[0]; aFrameCksum[1] = pWal->hdr.aFrameCksum[1]; } } sqlite3_free(aFrame); }else if( pbZero ){ *pbZero = 1; } } pWal->hdr.aFrameCksum[0] = aFrameCksum[0]; pWal->hdr.aFrameCksum[1] = aFrameCksum[1]; |
︙ | ︙ |
Changes to test/permutations.test.
︙ | ︙ | |||
426 427 428 429 430 431 432 | # Define the coverage related test suites: # # coverage-wal # test_suite "coverage-wal" -description { Coverage tests for file wal.c. } -files { | > > | > | | > > > | | 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 | # Define the coverage related test suites: # # coverage-wal # test_suite "coverage-wal" -description { Coverage tests for file wal.c. } -files { wal2big.test wal2recover.test wal2rewrite.test wal2simple.test wal2snapshot.test wal2.test wal3.test wal4.test wal5.test wal64k.test wal6.test wal7.test wal8.test wal9.test walbak.test walbig.test walblock.test walcksum.test walfault.test walhook.test walmode.test walnoshm.test waloverwrite.test walpersist.test walprotocol2.test walprotocol.test walro2.test walrofault.test walro.test walshared.test walslow.test wal.test wal2savepoint.test } test_suite "coverage-pager" -description { Coverage tests for file pager.c. } -files { pager1.test pager2.test pagerfault.test pagerfault2.test walfault.test walbak.test journal2.test tkt-9d68c883.test |
︙ | ︙ |
Changes to test/wal2recover.test.
︙ | ︙ | |||
158 159 160 161 162 163 164 165 166 167 | sqlite3 db2 test.db2 execsql { SELECT count(*) FROM t1; SELECT count(*) FROM t2; PRAGMA integrity_check; } db2 } {0 0 ok} finish_test | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 | sqlite3 db2 test.db2 execsql { SELECT count(*) FROM t1; SELECT count(*) FROM t2; PRAGMA integrity_check; } db2 } {0 0 ok} #------------------------------------------------------------------------- # reset_db do_execsql_test 3.0 { CREATE TABLE t1(a TEXT, b TEXT, c TEXT); CREATE INDEX t1a ON t1(a); CREATE INDEX t1b ON t1(b); CREATE INDEX t1c ON t1(c); PRAGMA journal_mode = wal2; PRAGMA journal_size_limit = 10000; PRAGMA wal_autocheckpoint = 0; PRAGMA cache_size = 5; } {wal2 10000 0} do_execsql_test 3.1 { WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s where i < 200) INSERT INTO t1 SELECT i, i, i FROM s; INSERT INTO t1 VALUES(201, 201, 201); } {} do_test 3.2 { list [file size test.db] [file size test.db-wal] [file size test.db-wal2] } {5120 15752 4224} do_test 3.3 { forcecopy test.db test.db2 forcecopy test.db-wal test.db2-wal forcecopy test.db-wal2 test.db2-wal2 sqlite3 db2 test.db2 execsql { PRAGMA journal_size_limit = 10000; PRAGMA wal_autocheckpoint = 0; PRAGMA cache_size = 5; BEGIN; WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s where i < 200) INSERT INTO t1 SELECT i, i, i FROM s; } db2 list [file size test.db2] [file size test.db2-wal] [file size test.db2-wal2] } {5120 15752 23088} do_test 3.4 { set fd [open test.db2-shm] fconfigure $fd -encoding binary -translation binary set data [read $fd] close $fd set fd [open test.db-shm w] fconfigure $fd -encoding binary -translation binary puts -nonewline $fd $data close $fd execsql { WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s where i < 10) INSERT INTO t1 SELECT i, i, i FROM s; SELECT count(*) FROM t1; PRAGMA integrity_check; } } {211 ok} do_test 3.5 { list [file size test.db] [file size test.db-wal] [file size test.db-wal2] } {5120 15752 18896} #------------------------------------------------------------------------- # reset_db do_execsql_test 4.0 { PRAGMA journal_mode = wal2; CREATE TABLE xyz(x, y, z); INSERT INTO xyz VALUES('x', 'y', 'z'); } {wal2} db close do_test 4.1 { close [open test.db-wal w] file mkdir test.db-wal2 sqlite3 db test.db catchsql { SELECT * FROM xyz } } {1 {unable to open database file}} db close file delete test.db-wal2 do_test 4.2 { sqlite3 db test.db execsql { INSERT INTO xyz VALUES('a', 'b', 'c'); } forcecopy test.db test.db2 forcecopy test.db-wal test.db2-wal forcedelete test.db2-wal2 file mkdir test.db2-wal2 sqlite3 db2 test.db2 catchsql { SELECT * FROM xyz } db2 } {1 {unable to open database file}} db2 close file delete test.db2-wal2 finish_test |
Added test/wal2savepoint.test.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | # 2018 December 13 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the operation of the library in # "PRAGMA journal_mode=WAL2" mode. # set testdir [file dirname $argv0] source $testdir/tester.tcl source $testdir/lock_common.tcl source $testdir/malloc_common.tcl source $testdir/wal_common.tcl set testprefix wal2savepoint ifcapable !wal {finish_test ; return } do_execsql_test 1.0 { CREATE TABLE t1(a, b, c); CREATE INDEX t1a ON t1(a); CREATE INDEX t1b ON t1(b); CREATE INDEX t1c ON t1(c); PRAGMA journal_mode = wal2; PRAGMA journal_size_limit = 15000; PRAGMA wal_autocheckpoint = 0; PRAGMA cache_size = 5; } {wal2 15000 0} do_execsql_test 1.1 { WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s where i < 200) INSERT INTO t1 SELECT random(), random(), random() FROM s; } {} do_test 1.2 { list [file size test.db] [file size test.db-wal] [file size test.db-wal2] } {5120 23088 0} do_execsql_test 1.3 { BEGIN; SAVEPOINT abc; WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s where i < 100) INSERT INTO t1 SELECT random(), random(), random() FROM s; ROLLBACK TO abc; WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s where i < 10) INSERT INTO t1 SELECT random(), random(), random() FROM s; COMMIT; SELECT count(*) FROM t1; PRAGMA integrity_check; } {210 ok} finish_test |