1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

In the pager, avoid checking for the illegal page number 0 except when creating

a new page.

FossilOrigin-Name: dee20ba982125ea98c280ad1571789af0f393903
This commit is contained in:
drh
2016-12-13 18:34:01 +00:00
parent d5df3ff2cc
commit cbed604f52
4 changed files with 18 additions and 21 deletions

View File

@@ -108,7 +108,7 @@ struct PCache {
int sqlite3PcachePageSanity(PgHdr *pPg){
PCache *pCache;
assert( pPg!=0 );
assert( pPg->pgno>0 ); /* Page number is 1 or more */
assert( pPg->pgno>0 || pPg->pPager==0 ); /* Page number is 1 or more */
pCache = pPg->pCache;
assert( pCache!=0 ); /* Every page has an associated PCache */
if( pPg->flags & PGHDR_CLEAN ){
@@ -372,7 +372,6 @@ sqlite3_pcache_page *sqlite3PcacheFetch(
assert( pCache!=0 );
assert( pCache->pCache!=0 );
assert( createFlag==3 || createFlag==0 );
assert( pgno>0 );
assert( pCache->eCreate==((pCache->bPurgeable && pCache->pDirty) ? 1 : 2) );
/* eCreate defines what to do if the page does not exist.