1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Backout check-in (4206) and replace it with a much better and more

general fix for the problem identified in ticket #2565. (CVS 4208)

FossilOrigin-Name: 7961a7385013d74ec78cbdfff6867c505528c163
This commit is contained in:
drh
2007-08-11 00:26:20 +00:00
parent 34f5621ff1
commit 8940f4ee56
3 changed files with 17 additions and 12 deletions

View File

@@ -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) 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-10T23:56:36 D 2007-08-11T00:26:21
F Makefile.in 0c0e53720f658c7a551046442dd7afba0b72bfbe F Makefile.in 0c0e53720f658c7a551046442dd7afba0b72bfbe
F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499 F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -99,7 +99,7 @@ F src/os_unix.c 9d2a421acc607262e63ccf31e3fe86e5f2520af6
F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e
F src/os_win.c d868d5f9e95ec9c1b9e2a30c54c996053db6dddd F src/os_win.c d868d5f9e95ec9c1b9e2a30c54c996053db6dddd
F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b
F src/pager.c 7a96ab0dcab56bd5c9828272b5ad5fc14b296c66 F src/pager.c cdf561d3ae4009be902df714da4518dc3522e206
F src/pager.h 94110a5570dca30d54a883e880a3633b2e4c05ae F src/pager.h 94110a5570dca30d54a883e880a3633b2e4c05ae
F src/parse.y ad2ce25665be7f7303137f774a4e3e72e0d036ff F src/parse.y ad2ce25665be7f7303137f774a4e3e72e0d036ff
F src/pragma.c 7914a6b9ea05f158800116dfcae11e52ab8e39c4 F src/pragma.c 7914a6b9ea05f158800116dfcae11e52ab8e39c4
@@ -524,7 +524,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5 F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
P 7ed2f59e70e0d9a8ad0c47c8c12fae0aaddcedce P 51f3e01b7486f23b67bdfb6bb19fc5297b2c8cec
R 035ac0a060bdc969e9fcae1ee2c83e7d R ad24378930c883b120cb56cf85c1ba0a
U drh U drh
Z 4968e3414a1d697b3f9b9029760dffed Z f296ba7bd96412db5f58676a175db9a3

View File

@@ -1 +1 @@
51f3e01b7486f23b67bdfb6bb19fc5297b2c8cec 7961a7385013d74ec78cbdfff6867c505528c163

View File

@@ -18,7 +18,7 @@
** file simultaneously, or one process from reading the database while ** file simultaneously, or one process from reading the database while
** another is writing. ** 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 #ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h" #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 /* 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 ** process and if this is the final header in the journal, then it means
** journalled copies of pages that need to be read back into the cache. ** 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); 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 ** very slow operation, so we work hard to avoid it. But sometimes
** it can't be helped. ** 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); int rc = syncJournal(pPager);
if( rc!=0 ){ if( rc!=0 ){
return rc; return rc;