1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Reorder conditions in sqlite3PagerDirectReadOk() for coverage.

FossilOrigin-Name: da9124fee28c155c4d1cc0d3949eb7b588a7236c12883a010af7909ad8e534ef
This commit is contained in:
drh
2024-10-23 11:33:56 +00:00
parent 98772d6e75
commit deb5ad6297
3 changed files with 12 additions and 12 deletions

View File

@ -817,11 +817,6 @@ int sqlite3PagerDirectReadOk(Pager *pPager, Pgno pgno){
assert( pPager!=0 );
assert( pPager->fd!=0 );
if( pPager->fd->pMethods==0 ) return 0; /* Case (1) */
assert( pPager->fd->pMethods->xDeviceCharacteristics!=0 );
if( (pPager->fd->pMethods->xDeviceCharacteristics(pPager->fd)
& SQLITE_IOCAP_SUBPAGE_READ)==0 ){
return 0; /* Case (2) */
}
if( sqlite3PCacheIsDirty(pPager->pPCache) ) return 0; /* Failed (3) */
#ifndef SQLITE_OMIT_WAL
if( pPager->pWal ){
@ -830,6 +825,11 @@ int sqlite3PagerDirectReadOk(Pager *pPager, Pgno pgno){
return iRead==0; /* Condition (4) */
}
#endif
assert( pPager->fd->pMethods->xDeviceCharacteristics!=0 );
if( (pPager->fd->pMethods->xDeviceCharacteristics(pPager->fd)
& SQLITE_IOCAP_SUBPAGE_READ)==0 ){
return 0; /* Case (2) */
}
return 1;
}
#endif