mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
More simplifications to pager.c. (CVS 6939)
FossilOrigin-Name: 533d6cc67a3b6467db5b83c5ca535d229d36ad27
This commit is contained in:
21
src/pager.c
21
src/pager.c
@@ -18,7 +18,7 @@
|
||||
** file simultaneously, or one process from reading the database while
|
||||
** another is writing.
|
||||
**
|
||||
** @(#) $Id: pager.c,v 1.623 2009/07/25 15:24:14 drh Exp $
|
||||
** @(#) $Id: pager.c,v 1.624 2009/07/25 17:08:36 drh Exp $
|
||||
*/
|
||||
#ifndef SQLITE_OMIT_DISKIO
|
||||
#include "sqliteInt.h"
|
||||
@@ -1179,21 +1179,8 @@ static int pager_error(Pager *pPager, int rc){
|
||||
pPager->errCode==SQLITE_OK ||
|
||||
(pPager->errCode & 0xff)==SQLITE_IOERR
|
||||
);
|
||||
if(
|
||||
rc2==SQLITE_FULL ||
|
||||
rc2==SQLITE_IOERR ||
|
||||
rc2==SQLITE_CORRUPT
|
||||
){
|
||||
if( rc2==SQLITE_FULL || rc2==SQLITE_IOERR ){
|
||||
pPager->errCode = rc;
|
||||
if( pPager->state==PAGER_UNLOCK
|
||||
&& sqlite3PcacheRefCount(pPager->pPCache)==0
|
||||
){
|
||||
/* If the pager is already unlocked, call pager_unlock() now to
|
||||
** clear the error state and ensure that the pager-cache is
|
||||
** completely empty.
|
||||
*/
|
||||
pager_unlock(pPager);
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
@@ -3065,7 +3052,9 @@ static int pagerStress(void *p, PgHdr *pPg){
|
||||
** Similarly, if the pager has already entered the error state, do not
|
||||
** try to write the contents of pPg to disk.
|
||||
*/
|
||||
if( pPager->errCode || (pPager->doNotSync && pPg->flags&PGHDR_NEED_SYNC) ){
|
||||
if( NEVER(pPager->errCode)
|
||||
|| (pPager->doNotSync && pPg->flags&PGHDR_NEED_SYNC)
|
||||
){
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user