aboutsummaryrefslogtreecommitdiff
path: root/src/pager.c
diff options
context:
space:
mode:
authordrh <>2022-07-04 09:41:44 +0000
committerdrh <>2022-07-04 09:41:44 +0000
commit16316f1b68de0f6778c067b5e0f0947b46a2bcdb (patch)
tree851358094075d7f2f9f3581352d6ca89105c51cc /src/pager.c
parent0e4ab0db7ee162e5d73437d3650078c145a68839 (diff)
downloadsqlite-16316f1b68de0f6778c067b5e0f0947b46a2bcdb.tar.gz
sqlite-16316f1b68de0f6778c067b5e0f0947b46a2bcdb.zip
In the getNormalPage() routine of pager.c, consolidate pgno error checking
into a single spot for small size reduction and performance increase. FossilOrigin-Name: a1c090e08139f99d30aa89db0756dc59fe8990ce15b3db4d4b726cc6acdab46f
Diffstat (limited to 'src/pager.c')
-rw-r--r--src/pager.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/pager.c b/src/pager.c
index 95e6eb8af..82e9dc7a6 100644
--- a/src/pager.c
+++ b/src/pager.c
@@ -5495,7 +5495,6 @@ static int getPageNormal(
assert( assert_pager_state(pPager) );
assert( pPager->hasHeldSharedLock==1 );
- if( pgno==0 ) return SQLITE_CORRUPT_BKPT;
pBase = sqlite3PcacheFetch(pPager->pPCache, pgno, 3);
if( pBase==0 ){
pPg = 0;
@@ -5526,7 +5525,7 @@ static int getPageNormal(
** (*) obsolete. Was: maximum page number is 2^31
** (2) Never try to fetch the locking page
*/
- if( pgno==PAGER_SJ_PGNO(pPager) ){
+ if( pgno==0 || pgno==PAGER_SJ_PGNO(pPager) ){
rc = SQLITE_CORRUPT_BKPT;
goto pager_acquire_err;
}