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

Fix the corruption problem of ticket #2565 as demonstrated by the test added

in (4204).  There may yet be other instances of similar problems lurking in
the code. (CVS 4206)

FossilOrigin-Name: 7ed2f59e70e0d9a8ad0c47c8c12fae0aaddcedce
This commit is contained in:
drh
2007-08-10 23:54:16 +00:00
parent 9fa502205d
commit fdd30b0e46
3 changed files with 10 additions and 10 deletions

View File

@@ -18,7 +18,7 @@
** file simultaneously, or one process from reading the database while
** another is writing.
**
** @(#) $Id: pager.c,v 1.352 2007/08/07 17:13:04 drh Exp $
** @(#) $Id: pager.c,v 1.353 2007/08/10 23:54:16 drh Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"
@@ -2625,7 +2625,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 && syncOk && !MEMDB){
if( pPg==0 && pPager->pFirst && pPager->nRec && syncOk && !MEMDB){
int rc = syncJournal(pPager);
if( rc!=0 ){
return rc;