]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Backout check-in (4206) and replace it with a much better and more
authordrh <drh@noemail.net>
Sat, 11 Aug 2007 00:26:20 +0000 (00:26 +0000)
committerdrh <drh@noemail.net>
Sat, 11 Aug 2007 00:26:20 +0000 (00:26 +0000)
general fix for the problem identified in ticket #2565. (CVS 4208)

FossilOrigin-Name: 7961a7385013d74ec78cbdfff6867c505528c163

manifest
manifest.uuid
src/pager.c

index ffff6c33cfc9d26e555eefe5f2808a097d164f17..9caa422686353f28f5f5b5b621b26423e073f3d4 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\ssome\sincorrect\sasserts()\sin\sthe\spager\s-\sproblems\sbrought\sto\slight\sby\nthe\snew\ssoft-heap-limit\stesting\sapparatus\sof\scheck-in\s(4202).\s(CVS\s4207)
-D 2007-08-10T23:56:36
+C Backout\scheck-in\s(4206)\sand\sreplace\sit\swith\sa\smuch\sbetter\sand\smore\ngeneral\sfix\sfor\sthe\sproblem\sidentified\sin\sticket\s#2565.\s(CVS\s4208)
+D 2007-08-11T00:26:21
 F Makefile.in 0c0e53720f658c7a551046442dd7afba0b72bfbe
 F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499
 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -99,7 +99,7 @@ F src/os_unix.c 9d2a421acc607262e63ccf31e3fe86e5f2520af6
 F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e
 F src/os_win.c d868d5f9e95ec9c1b9e2a30c54c996053db6dddd
 F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b
-F src/pager.c 7a96ab0dcab56bd5c9828272b5ad5fc14b296c66
+F src/pager.c cdf561d3ae4009be902df714da4518dc3522e206
 F src/pager.h 94110a5570dca30d54a883e880a3633b2e4c05ae
 F src/parse.y ad2ce25665be7f7303137f774a4e3e72e0d036ff
 F src/pragma.c 7914a6b9ea05f158800116dfcae11e52ab8e39c4
@@ -524,7 +524,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
 F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
-P 7ed2f59e70e0d9a8ad0c47c8c12fae0aaddcedce
-R 035ac0a060bdc969e9fcae1ee2c83e7d
+P 51f3e01b7486f23b67bdfb6bb19fc5297b2c8cec
+R ad24378930c883b120cb56cf85c1ba0a
 U drh
-Z 4968e3414a1d697b3f9b9029760dffed
+Z f296ba7bd96412db5f58676a175db9a3
index a37a12de3e4d70b1d3f70d5083f5507a897e392e..c05df8e9468ed3794a3ce42ff7afd64349488f29 100644 (file)
@@ -1 +1 @@
-51f3e01b7486f23b67bdfb6bb19fc5297b2c8cec
\ No newline at end of file
+7961a7385013d74ec78cbdfff6867c505528c163
\ No newline at end of file
index 5c95f8ab497d6a56ca3afc51e510f094a0a4e89e..1202b779542dbd461dfab7b828bfee4627b25f46 100644 (file)
@@ -18,7 +18,7 @@
 ** file simultaneously, or one process from reading the database while
 ** another is writing.
 **
-** @(#) $Id: pager.c,v 1.354 2007/08/10 23:56:36 drh Exp $
+** @(#) $Id: pager.c,v 1.355 2007/08/11 00:26:21 drh Exp $
 */
 #ifndef SQLITE_OMIT_DISKIO
 #include "sqliteInt.h"
@@ -1455,10 +1455,15 @@ static int pager_playback(Pager *pPager, int isHot){
     }
 
     /* If nRec is 0 and this rollback is of a transaction created by this
-    ** process. In this case the rest of the journal file consists of
-    ** journalled copies of pages that need to be read back into the cache.
+    ** process and if this is the final header in the journal, then it means
+    ** that this part of the journal was being filled but has not yet been
+    ** synced to disk.  Compute the number of pages based on the remaining
+    ** size of the file.
+    **
+    ** The third term of the test was added to fix ticket #2565.
     */
-    if( nRec==0 && !isHot ){
+    if( nRec==0 && !isHot &&
+        pPager->journalHdr+JOURNAL_HDR_SZ(pPager)==pPager->journalOff ){
       nRec = (szJ - pPager->journalOff) / JOURNAL_PG_SZ(pPager);
     }
 
@@ -2629,7 +2634,7 @@ static int pager_recycle(Pager *pPager, int syncOk, PgHdr **ppPg){
   ** very slow operation, so we work hard to avoid it.  But sometimes
   ** it can't be helped.
   */
-  if( pPg==0 && pPager->pFirst && pPager->nRec && syncOk && !MEMDB){
+  if( pPg==0 && pPager->pFirst && syncOk && !MEMDB){
     int rc = syncJournal(pPager);
     if( rc!=0 ){
       return rc;