]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix ioerr5.test so that it works with the new pcache module. (CVS 5636)
authordanielk1977 <danielk1977@noemail.net>
Thu, 28 Aug 2008 18:35:34 +0000 (18:35 +0000)
committerdanielk1977 <danielk1977@noemail.net>
Thu, 28 Aug 2008 18:35:34 +0000 (18:35 +0000)
FossilOrigin-Name: 83e6a75e7d70b4b01f0892924d7a8a49d5ef6bf2

manifest
manifest.uuid
test/ioerr5.test

index 6111e006dd3c8476af10864d778d4f04402f54f6..d65fd386ab4e1a93b31367b0e45f958536eed556 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Partial\sfix\sfor\sa\sbug\sin\srecovery\sfrom\sxStress\sfailures\sin\spcache.\s(CVS\s5635)
-D 2008-08-28T17:46:19
+C Fix\sioerr5.test\sso\sthat\sit\sworks\swith\sthe\snew\spcache\smodule.\s(CVS\s5636)
+D 2008-08-28T18:35:34
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in 689e14735f862a5553bceef206d8c13e29504e44
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -376,7 +376,7 @@ F test/ioerr.test b42f249c9181b5864e53fdae38ef75475d71c66f
 F test/ioerr2.test 988bda4d8d6fa1593765a514bf7a24adb3240da9
 F test/ioerr3.test d3cec5e1a11ad6d27527d0d38573fbff14c71bdd
 F test/ioerr4.test fc6eddfec2efc2f1ed217b9eae4c1c1d3516ce86
-F test/ioerr5.test fe59ee3e3d45a121bcdb8f462b718076e66b4ca7
+F test/ioerr5.test 89f69b09a6b5d4f5bbfe58d4231f28236d842dcb
 F test/join.test e0664af757049ba1f19a0d42c470a58299f36a3e
 F test/join2.test f2171c265e57ee298a27e57e7051d22962f9f324
 F test/join3.test 6f0c774ff1ba0489e6c88a3e77b9d3528fb4fda0
@@ -625,7 +625,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 1dbced29de5f59ba2ebf877edcadf171540374d1
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P b606263d0868aed267bcec623b9fe4d142099145
-R 583df9a59ceb3abe3e9babb420a62f8c
-U drh
-Z d2e0132b284492803c0e9b5e5f2053d7
+P 44193b92770062271711570d8532fa5af5f5da54
+R b653a7b6746fff19fe5c3b4b1ca78010
+U danielk1977
+Z e1c85e2c49e0ca001d86550ca68a5398
index 2753c8c2803110ab01947f3442ce3a88614d46ef..ab3f51f88dd451bef0d1fe6a0d69889d6561c877 100644 (file)
@@ -1 +1 @@
-44193b92770062271711570d8532fa5af5f5da54
\ No newline at end of file
+83e6a75e7d70b4b01f0892924d7a8a49d5ef6bf2
\ No newline at end of file
index f22e0390693010c7c6a9388204bf449a14854900..6e9014539f1c00385a0410a627c7ded6838bbf7a 100644 (file)
@@ -14,7 +14,7 @@
 # incorrectly write dirty pages out to the database (not safe to do
 # once the pager is in error state).
 #
-# $Id: ioerr5.test,v 1.4 2008/07/12 14:52:20 drh Exp $
+# $Id: ioerr5.test,v 1.5 2008/08/28 18:35:34 danielk1977 Exp $
 
 set testdir [file dirname $argv0]
 source $testdir/tester.tcl
@@ -77,6 +77,7 @@ do_test ioerr5-1.0 {
 } {}
 
 foreach locking_mode {normal exclusive} {
+  set nPage 2
   for {set iFail 1} {$iFail<200} {incr iFail} {
     sqlite3_soft_heap_limit 1048576
     opendatabases
@@ -117,12 +118,25 @@ foreach locking_mode {normal exclusive} {
     # with the dirty page.
     #
     do_test ioerr5-1.$locking_mode-$iFail.3 {
+      set bt [btree_from_db db]
       sqlite3_soft_heap_limit 1024
       compilesql16 "SELECT 10"
-      set bt [btree_from_db db]
       array set stats [btree_pager_stats $bt]
-      set stats(page)
-    } {0}
+
+      # If the pager made it all the way to PAGER_SYNCED state, then 
+      # both in-memory pages are clean. Following the calls to 
+      # release_memory() that were made as part of the [compilesql16]
+      # above, there will be zero pages left in the cache.
+      #
+      # If the pager did not make it as far as PAGER_SYNCED, the two
+      # in memory pages are still dirty. So there will be 2 pages left
+      # in the cache following the release_memory() calls.
+      #
+      if {$stats(state)==5} {
+        set nPage 0
+      }
+      expr {$stats(page)==$nPage}
+    } {1}
 
     # Ensure that nothing was written to the database while reclaiming
     # memory from the pager in error state.