]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Extra tests for "PRAGMA checkpoint_fullfsync".
authordan <dan@noemail.net>
Sat, 20 Nov 2010 12:01:35 +0000 (12:01 +0000)
committerdan <dan@noemail.net>
Sat, 20 Nov 2010 12:01:35 +0000 (12:01 +0000)
FossilOrigin-Name: e38c81cc18d2ceaa1644aaba64530ba5d1fbf2cf

manifest
manifest.uuid
test/wal2.test

index 975520b565fa99f802d9c7d846f4d6732c55fede..eab536af70e6ba6462a6e020c61548a2ea594054 100644 (file)
--- 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
index 971755760c67ba3dff08e3121fcc33cf5f5f7bc4..7e383adb3778c6d50cde85f5ea899be838ad9862 100644 (file)
@@ -1 +1 @@
-1c4e58e7211522f0e7dfddd3a2b52f1d0c5421e7
\ No newline at end of file
+e38c81cc18d2ceaa1644aaba64530ba5d1fbf2cf
\ No newline at end of file
index 5dfc25525182a0c97a42ce061b5c546e498a7717..e31fe794937bd6381841e5a0e970df0b04c58db2 100644 (file)
@@ -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