From: dan Date: Sat, 20 Nov 2010 12:01:35 +0000 (+0000) Subject: Extra tests for "PRAGMA checkpoint_fullfsync". X-Git-Tag: version-3.7.4~42 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=18826195f28f7acd89e95b200efd22bfdcdbfdd0;p=thirdparty%2Fsqlite.git Extra tests for "PRAGMA checkpoint_fullfsync". FossilOrigin-Name: e38c81cc18d2ceaa1644aaba64530ba5d1fbf2cf --- diff --git a/manifest b/manifest index 975520b565..eab536af70 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sextra\stests\sfor\stest_superlock.c. -D 2010-11-20T10:57:45 +C Extra\stests\sfor\s"PRAGMA\scheckpoint_fullfsync". +D 2010-11-20T12:01:35 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in e7a59672eaeb04408d1fa8501618d7501a3c5e39 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -827,7 +827,7 @@ F test/vtab_alter.test 9e374885248f69e251bdaacf480b04a197f125e5 F test/vtab_err.test 0d4d8eb4def1d053ac7c5050df3024fd47a3fbd8 F test/vtab_shared.test 0eff9ce4f19facbe0a3e693f6c14b80711a4222d F test/wal.test 70227190e713b3e7eb2a7d5ec3510b66db01f327 -F test/wal2.test f4ad3095da5269c89c823e7090ba2c116cdd1d63 +F test/wal2.test 3de797854de175323e7351b5f2514a30d1ee1410 F test/wal3.test 957a5f2a8fe8a6ff01de1a15285ecf2f376fcaf8 F test/wal4.test 3404b048fa5e10605facaf70384e6d2943412e30 F test/wal_common.tcl 895d76138043b86bdccf36494054bdabcf65837b @@ -889,7 +889,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P 765aa1b862fa38cede89bafe0e10c094e0544b7e -R 27d92142897c9c2c878d22b56828d49b +P 1c4e58e7211522f0e7dfddd3a2b52f1d0c5421e7 +R 4649b295d741e65ee02f98dbf236e8f0 U dan -Z 81c82ffdb9a719f67547d604c72658bc +Z dd0957804bd79388ac36a7f3739f3c85 diff --git a/manifest.uuid b/manifest.uuid index 971755760c..7e383adb37 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1c4e58e7211522f0e7dfddd3a2b52f1d0c5421e7 \ No newline at end of file +e38c81cc18d2ceaa1644aaba64530ba5d1fbf2cf \ No newline at end of file diff --git a/test/wal2.test b/test/wal2.test index 5dfc255251..e31fe79493 100644 --- a/test/wal2.test +++ b/test/wal2.test @@ -19,6 +19,8 @@ source $testdir/lock_common.tcl source $testdir/malloc_common.tcl source $testdir/wal_common.tcl +set testprefix wal2 + ifcapable !wal {finish_test ; return } proc set_tvfs_hdr {file args} { @@ -1207,6 +1209,72 @@ foreach {tn sql reslist} { } [lrange $reslist 4 5] } +catch { db close } + +# PRAGMA checkpoint_fullsync +# PRAGMA fullfsync +# PRAGMA synchronous +# +foreach {tn settings commit_sync ckpt_sync} { + 1 {0 0 off} {0 0} {0 0} + 2 {0 0 normal} {0 0} {2 0} + 3 {0 0 full} {1 0} {2 0} + + 4 {0 1 off} {0 0} {0 0} + 5 {0 1 normal} {0 0} {0 2} + 6 {0 1 full} {0 1} {0 2} + + 7 {1 0 off} {0 0} {0 0} + 8 {1 0 normal} {0 0} {0 2} + 9 {1 0 full} {1 0} {0 2} + + 10 {1 1 off} {0 0} {0 0} + 11 {1 1 normal} {0 0} {0 2} + 12 {1 1 full} {0 1} {0 2} +} { + forcedelete test.db + + testvfs tvfs -default 1 + tvfs filter xSync + tvfs script xSyncCb + proc xSyncCb {method file fileid flags} { + incr ::sync($flags) + } + + sqlite3 db test.db + do_execsql_test 15.$tn.1 " + CREATE TABLE t1(x); + PRAGMA journal_mode = WAL; + PRAGMA checkpoint_fullfsync = [lindex $settings 0]; + PRAGMA fullfsync = [lindex $settings 1]; + PRAGMA synchronous = [lindex $settings 2]; + " {wal} + + do_test 15.$tn.2 { + set sync(normal) 0 + set sync(full) 0 + execsql { INSERT INTO t1 VALUES('abc') } + list $::sync(normal) $::sync(full) + } $commit_sync + + do_test 15.$tn.3 { + set sync(normal) 0 + set sync(full) 0 + execsql { INSERT INTO t1 VALUES('def') } + list $::sync(normal) $::sync(full) + } $commit_sync + + do_test 15.$tn.4 { + set sync(normal) 0 + set sync(full) 0 + execsql { PRAGMA wal_checkpoint } + list $::sync(normal) $::sync(full) + } $ckpt_sync + + db close + tvfs delete +} + finish_test