aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <>2024-01-02 21:37:51 +0000
committerdrh <>2024-01-02 21:37:51 +0000
commitf5740f72ecc3e52da9dc6321dd3361c65f1125ca (patch)
tree520182d1383efcfd522cdafa0966a28850a031a3 /src
parent4eb626350a8359671fa62712be5b33d4a605d444 (diff)
downloadsqlite-f5740f72ecc3e52da9dc6321dd3361c65f1125ca.tar.gz
sqlite-f5740f72ecc3e52da9dc6321dd3361c65f1125ca.zip
Adjust the sqlite3PagerDirectReadOk() routine (part of the
SQLITE_DIRECT_OVERFLOW_READ optimization) to use less code and to be more easily testable. FossilOrigin-Name: eed670ea2a9424f7df4eeb01c152fc38f7190a5e39aa891651b28dc91fcdc019
Diffstat (limited to 'src')
-rw-r--r--src/pager.c5
-rw-r--r--src/wal.c1
2 files changed, 3 insertions, 3 deletions
diff --git a/src/pager.c b/src/pager.c
index f779d7457..37588f0b2 100644
--- a/src/pager.c
+++ b/src/pager.c
@@ -818,9 +818,8 @@ int sqlite3PagerDirectReadOk(Pager *pPager, Pgno pgno){
#ifndef SQLITE_OMIT_WAL
if( pPager->pWal ){
u32 iRead = 0;
- int rc;
- rc = sqlite3WalFindFrame(pPager->pWal, pgno, &iRead);
- return (rc==SQLITE_OK && iRead==0);
+ (void)sqlite3WalFindFrame(pPager->pWal, pgno, &iRead);
+ return iRead==0;
}
#endif
return 1;
diff --git a/src/wal.c b/src/wal.c
index fa22e64c8..eb97831dc 100644
--- a/src/wal.c
+++ b/src/wal.c
@@ -3505,6 +3505,7 @@ static int walFindFrame(
iRead = iFrame;
}
if( (nCollide--)==0 ){
+ *piRead = 0;
return SQLITE_CORRUPT_BKPT;
}
iKey = walNextHash(iKey);