diff options
author | drh <> | 2024-01-02 21:37:51 +0000 |
---|---|---|
committer | drh <> | 2024-01-02 21:37:51 +0000 |
commit | f5740f72ecc3e52da9dc6321dd3361c65f1125ca (patch) | |
tree | 520182d1383efcfd522cdafa0966a28850a031a3 /src | |
parent | 4eb626350a8359671fa62712be5b33d4a605d444 (diff) | |
download | sqlite-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.c | 5 | ||||
-rw-r--r-- | src/wal.c | 1 |
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; @@ -3505,6 +3505,7 @@ static int walFindFrame( iRead = iFrame; } if( (nCollide--)==0 ){ + *piRead = 0; return SQLITE_CORRUPT_BKPT; } iKey = walNextHash(iKey); |