mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
Make SQLITE_DIRECT_OVERFLOW_READ work for in WAL mode as long as the page
being read is not in the the -wal file. FossilOrigin-Name: 9879be1899adf5634f551a2077b15ccb1133e4e3
This commit is contained in:
18
src/pager.c
18
src/pager.c
@@ -814,14 +814,20 @@ static const unsigned char aJournalMagic[] = {
|
||||
#define isOpen(pFd) ((pFd)->pMethods!=0)
|
||||
|
||||
/*
|
||||
** Return true if this pager uses a write-ahead log instead of the usual
|
||||
** rollback journal. Otherwise false.
|
||||
** Return true if this pager uses a write-ahead log to read page pgno.
|
||||
** Return false if the pager reads pgno directly from the database.
|
||||
*/
|
||||
#ifndef SQLITE_OMIT_WAL
|
||||
int sqlite3PagerUseWal(Pager *pPager){
|
||||
return (pPager->pWal!=0);
|
||||
#if !defined(SQLITE_OMIT_WAL) && defined(SQLITE_DIRECT_OVERFLOW_READ)
|
||||
int sqlite3PagerUseWal(Pager *pPager, Pgno pgno){
|
||||
u32 iRead = 0;
|
||||
int rc;
|
||||
if( pPager->pWal==0 ) return 0;
|
||||
rc = sqlite3WalFindFrame(pPager->pWal, pgno, &iRead);
|
||||
return rc || iRead;
|
||||
}
|
||||
# define pagerUseWal(x) sqlite3PagerUseWal(x)
|
||||
#endif
|
||||
#ifndef SQLITE_OMIT_WAL
|
||||
# define pagerUseWal(x) ((x)->pWal!=0)
|
||||
#else
|
||||
# define pagerUseWal(x) 0
|
||||
# define pagerRollbackWal(x) 0
|
||||
|
Reference in New Issue
Block a user