1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

It is no longer possible to reach pagerStress() while in the error state,

so put a NEVER() around the error state test of that routine.

FossilOrigin-Name: d7ed463496c4474cc435d032874a4e55d780e74a
This commit is contained in:
drh
2010-08-17 18:37:12 +00:00
parent a81a2207a3
commit 0028486b73
3 changed files with 25 additions and 10 deletions

View File

@@ -4053,9 +4053,14 @@ static int pagerStress(void *p, PgHdr *pPg){
** The doNotSpill flag inhibits all cache spilling regardless of whether
** or not a sync is required. This is set during a rollback.
**
** Spilling is also inhibited when in an error state.
** Spilling is also prohibited when in an error state since that could
** lead to database corruption. In the current implementaton it
** is impossible for sqlite3PCacheFetch() to be called with createFlag==1
** while in the error state, hence it is impossible for this routine to
** be called in the error state. Nevertheless, we include a NEVER()
** test for the error state as a safeguard against future changes.
*/
if( pPager->errCode ) return SQLITE_OK;
if( NEVER(pPager->errCode) ) return SQLITE_OK;
if( pPager->doNotSpill ) return SQLITE_OK;
if( pPager->doNotSyncSpill && (pPg->flags & PGHDR_NEED_SYNC)!=0 ){
return SQLITE_OK;