]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix some test code problems in "permutations.test journaltest pager.test". (CVS 6109)
authordanielk1977 <danielk1977@noemail.net>
Mon, 5 Jan 2009 17:15:00 +0000 (17:15 +0000)
committerdanielk1977 <danielk1977@noemail.net>
Mon, 5 Jan 2009 17:15:00 +0000 (17:15 +0000)
FossilOrigin-Name: cf627752c4537f709acae26a1e335731d55bddb2

manifest
manifest.uuid
src/test_journal.c
test/pager.test

index eb38eedc32f998c1cf55c59fe9799d5c80ed2f1c..f73702454943a6ab0fe6518a9e6cfd7b32528b34 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Add\ssome\stests\swith\sattached\sdatabases\sto\ssavepoint.test.\sAlso\stests\sof\screating\sand\sdropping\stables\sin\sauto-vacuum\smode\sinside\sof\sa\ssavepoint.\s(CVS\s6108)
-D 2009-01-03T15:06:38
+C Fix\ssome\stest\scode\sproblems\sin\s"permutations.test\sjournaltest\spager.test".\s(CVS\s6109)
+D 2009-01-05T17:15:00
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in 05461a9b5803d5ad10c79f989801e9fd2cc3e592
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -179,7 +179,7 @@ F src/test_config.c 4f85387a52f3c7966c3ffab913e988a3830fe1af
 F src/test_devsym.c 9f4bc2551e267ce7aeda195f3897d0f30c5228f4
 F src/test_func.c a55c4d5479ff2eb5c0a22d4d88e9528ab59c953b
 F src/test_hexio.c 2f1122aa3f012fa0142ee3c36ce5c902a70cd12f
-F src/test_journal.c 3e1ff6dc251afadde009a791f863132cf861bda6
+F src/test_journal.c 036ad7ab47ba262a812189ca16fe3e9033bdbdb3
 F src/test_loadext.c 97dc8800e46a46ed002c2968572656f37e9c0dd9
 F src/test_malloc.c 5127337c9fb4c851a7f604c0170e0e5ca1fbfe33
 F src/test_md5.c 28209a4e2068711b5443c33104fe41f21d160071
@@ -470,7 +470,7 @@ F test/nan.test c627d79b3d36ea892563fd67584b3e8a18f0618a
 F test/notnull.test 44d600f916b770def8b095a9962dbe3be5a70d82
 F test/null.test a8b09b8ed87852742343b33441a9240022108993
 F test/openv2.test f5dd6b23e4dce828eb211649b600763c42a668df
-F test/pager.test fd3f5009985728ef7bf0dfe32a1bbc112e6895c5
+F test/pager.test ef306077e282963664be71ac31832f4476e557ca
 F test/pager2.test d4b7f6b70ff018b9995e622a32526b275f515042
 F test/pager3.test 2323bf27fd5bd887b580247e5bce500ceee994b4
 F test/pageropt.test 3ee6578891baaca967f0bd349e4abfa736229e1a
@@ -692,7 +692,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P 27ae406537c07073db46ecde40c65c78fbb73170
-R f1261b4aaf79058f39badb22de0f89d4
+P ca7f11d50d1a73443d18c79dfe4223c975c6e20b
+R ad21cedccb12837ed3f3ff34f42a0906
 U danielk1977
-Z 89a8f6d28c2f24e84f9c102fa36950dc
+Z 72c33f7e7d1fe921a91d58bf25243ee9
index 6cac826953600b0529c0e8a7dc47832223368f04..25bbaaa1cfc160b83cd9436aab9db1669059317b 100644 (file)
@@ -1 +1 @@
-ca7f11d50d1a73443d18c79dfe4223c975c6e20b
\ No newline at end of file
+cf627752c4537f709acae26a1e335731d55bddb2
\ No newline at end of file
index ba5a5cc91309db1e14716d7447e6310b99f64be1..b1cd5b8601b7a81b566d97ecdbae3430c94b7b56 100644 (file)
@@ -19,7 +19,7 @@
 **   b) the page was not a free-list leaf page when the transaction was
 **      first opened.
 **
-** $Id: test_journal.c,v 1.3 2008/12/24 09:30:22 danielk1977 Exp $
+** $Id: test_journal.c,v 1.4 2009/01/05 17:15:00 danielk1977 Exp $
 */
 #if SQLITE_TEST          /* This file is used for testing only */
 
@@ -315,10 +315,20 @@ static int readJournalFile(jt_file *p, jt_file *pMain){
     if( rc!=SQLITE_OK 
      || decodeJournalHdr(zBuf, &nRec, &nPage, &nSector, &nPagesize) 
     ){
-      return rc;
+      goto finish_rjf;
     }
     iOff += nSector;
     if( nRec==0 ){
+      /* A trick. There might be another journal-header immediately 
+      ** following this one. In this case, 0 records means 0 records, 
+      ** not "read until the end of the file". See also ticket #2565.
+      */
+      if( iSize>=(nRec+nSector) ){
+        rc = sqlite3OsRead(pReal, zBuf, 28, iOff);
+        if( rc!=SQLITE_OK || 0==decodeJournalHdr(zBuf, 0, 0, 0, 0) ){
+          continue;
+        }
+      }
       nRec = (iSize - iOff)/(pMain->nPagesize + 8);
     }
     for(ii=0; rc==SQLITE_OK && ii<nRec && iOff<iSize; ii++){
@@ -336,6 +346,10 @@ static int readJournalFile(jt_file *p, jt_file *pMain){
     iOff = ((iOff + (nSector-1)) / nSector) * nSector;
   }
 
+finish_rjf:
+  if( rc==SQLITE_IOERR_SHORT_READ ){
+    rc = SQLITE_OK;
+  }
   return rc;
 }
 
index 32265a521198e1df5f56e0bdb825648a7b42a565..037112e5db9f11b51e1b955df9815c58c1f421c9 100644 (file)
@@ -11,7 +11,7 @@
 # This file implements regression tests for SQLite library.  The
 # focus of this script is page cache subsystem.
 #
-# $Id: pager.test,v 1.32 2008/10/17 18:51:53 danielk1977 Exp $
+# $Id: pager.test,v 1.33 2009/01/05 17:15:00 danielk1977 Exp $
 
 
 set testdir [file dirname $argv0]
@@ -214,6 +214,7 @@ do_test pager-3.5 {
     page_write $gx "Page-$i"
     page_unref $gx
   }
+breakpoint
   pager_commit $::p1
   page_unref $::g(1)
 } {}
@@ -459,8 +460,14 @@ do_test pager-5.1 {
 # The following tests cover rolling back hot journal files. 
 # They can't be run on windows because the windows version of 
 # SQLite holds a mandatory exclusive lock on journal files it has open.
+# 
+# They cannot be run during the journaltest permutation because 
+# "PRAGMA synchronous = 0" is used.
 #
-if {$tcl_platform(platform)!="windows"} {
+if {$tcl_platform(platform)!="windows" && (
+      0 == [info exists ::permutations_test_prefix] 
+   || $::permutations_test_prefix ne "journaltest"
+)} {
 do_test pager-6.1 {
   file delete -force test2.db
   file delete -force test2.db-journal