aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/sqlite.h.in7
-rw-r--r--src/wal.c4
2 files changed, 11 insertions, 0 deletions
diff --git a/src/sqlite.h.in b/src/sqlite.h.in
index c61c0e8b3..a9f56aabe 100644
--- a/src/sqlite.h.in
+++ b/src/sqlite.h.in
@@ -1111,6 +1111,12 @@ struct sqlite3_io_methods {
** called. This file control is the only mechanism to detect changes that
** happen either internally or externally and that are associated with
** a particular attached database.
+**
+** <li>[[SQLITE_FCNTL_CKPT_DONE]]
+** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint
+** in wal mode after the client has finished copying pages from the wal
+** file to the database file, but before the *-shm file is updated to
+** record the fact that the pages have been checkpointed.
** </ul>
*/
#define SQLITE_FCNTL_LOCKSTATE 1
@@ -1148,6 +1154,7 @@ struct sqlite3_io_methods {
#define SQLITE_FCNTL_LOCK_TIMEOUT 34
#define SQLITE_FCNTL_DATA_VERSION 35
#define SQLITE_FCNTL_SIZE_LIMIT 36
+#define SQLITE_FCNTL_CKPT_DONE 37
/* deprecated names */
#define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE
diff --git a/src/wal.c b/src/wal.c
index 3d4a541d5..9873f8bf0 100644
--- a/src/wal.c
+++ b/src/wal.c
@@ -1914,6 +1914,10 @@ static int walCheckpoint(
}
}
if( rc==SQLITE_OK ){
+ rc = sqlite3OsFileControl(pWal->pDbFd, SQLITE_FCNTL_CKPT_DONE, 0);
+ if( rc==SQLITE_NOTFOUND ) rc = SQLITE_OK;
+ }
+ if( rc==SQLITE_OK ){
pInfo->nBackfill = mxSafeFrame;
}
}