aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <>2024-12-16 13:25:49 +0000
committerdrh <>2024-12-16 13:25:49 +0000
commitbd1a5932d9fe3b9b75a6cf22bb7e96063f28ccec (patch)
treede29a23240c2ac4c315f47bc4c8a4d513f4b62c3 /src
parent276172e4a3cb1ca03e6b498776b735378030efdb (diff)
downloadsqlite-bd1a5932d9fe3b9b75a6cf22bb7e96063f28ccec.tar.gz
sqlite-bd1a5932d9fe3b9b75a6cf22bb7e96063f28ccec.zip
Changes for better alignment with the wal2 branch.
FossilOrigin-Name: 4fab85b3d0d1cad2d185f2456de7ddf281badf8561cc051e10e16655441dcc84
Diffstat (limited to 'src')
-rw-r--r--src/pager.c16
-rw-r--r--src/pager.h16
2 files changed, 17 insertions, 15 deletions
diff --git a/src/pager.c b/src/pager.c
index 4f616f0c7..e2dbbeae3 100644
--- a/src/pager.c
+++ b/src/pager.c
@@ -789,20 +789,6 @@ static const unsigned char aJournalMagic[] = {
# define USEFETCH(x) 0
#endif
-/*
-** The argument to this macro is a file descriptor (type sqlite3_file*).
-** Return 0 if it is not open, or non-zero (but not 1) if it is.
-**
-** This is so that expressions can be written as:
-**
-** if( isOpen(pPager->jfd) ){ ...
-**
-** instead of
-**
-** if( pPager->jfd->pMethods ){ ...
-*/
-#define isOpen(pFd) ((pFd)->pMethods!=0)
-
#ifdef SQLITE_DIRECT_OVERFLOW_READ
/*
** Return true if page pgno can be read directly from the database file
@@ -2088,7 +2074,7 @@ static int pager_end_transaction(Pager *pPager, int hasSuper, int bCommit){
}
pPager->journalOff = 0;
}else if( pPager->journalMode==PAGER_JOURNALMODE_PERSIST
- || (pPager->exclusiveMode && pPager->journalMode!=PAGER_JOURNALMODE_WAL)
+ || (pPager->exclusiveMode && pPager->journalMode<PAGER_JOURNALMODE_WAL)
){
rc = zeroJournalHdr(pPager, hasSuper||pPager->tempFile);
pPager->journalOff = 0;
diff --git a/src/pager.h b/src/pager.h
index 7ef9a237a..9b2cfc0bc 100644
--- a/src/pager.h
+++ b/src/pager.h
@@ -83,6 +83,22 @@ typedef struct PgHdr DbPage;
#define PAGER_JOURNALMODE_MEMORY 4 /* In-memory journal file */
#define PAGER_JOURNALMODE_WAL 5 /* Use write-ahead logging */
+#define isWalMode(x) ((x)==PAGER_JOURNALMODE_WAL)
+
+/*
+** The argument to this macro is a file descriptor (type sqlite3_file*).
+** Return 0 if it is not open, or non-zero (but not 1) if it is.
+**
+** This is so that expressions can be written as:
+**
+** if( isOpen(pPager->jfd) ){ ...
+**
+** instead of
+**
+** if( pPager->jfd->pMethods ){ ...
+*/
+#define isOpen(pFd) ((pFd)->pMethods!=0)
+
/*
** Flags that make up the mask passed to sqlite3PagerGet().
*/