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

A simple optimization and size reduction in sqlite3PagerAcquire().

FossilOrigin-Name: 618d8dd4ff44cce10cc4688a2134715ff66cc562
This commit is contained in:
drh
2015-09-03 18:20:10 +00:00
parent c98a4cc8b6
commit 98c5f8795a
3 changed files with 11 additions and 11 deletions

View File

@@ -5254,20 +5254,20 @@ int sqlite3PagerAcquire(
** page 1 if there is no write-transaction open or the ACQUIRE_READONLY
** flag was specified by the caller. And so long as the db is not a
** temporary or in-memory database. */
const int bMmapOk = (pgno!=1 && USEFETCH(pPager)
const int bMmapOk = (pgno>1 && USEFETCH(pPager)
&& (pPager->eState==PAGER_READER || (flags & PAGER_GET_READONLY))
#ifdef SQLITE_HAS_CODEC
&& pPager->xCodec==0
#endif
);
if( pgno<=1 && pgno==0 ){
return SQLITE_CORRUPT_BKPT;
}
assert( pPager->eState>=PAGER_READER );
assert( assert_pager_state(pPager) );
assert( noContent==0 || bMmapOk==0 );
if( pgno==0 ){
return SQLITE_CORRUPT_BKPT;
}
assert( pPager->hasHeldSharedLock==1 );
/* If the pager is in the error state, return an error immediately.