diff options
author | dan <dan@noemail.net> | 2020-01-16 16:32:57 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2020-01-16 16:32:57 +0000 |
commit | 1d7d8c8f74b44fb54fb15539a4191ea68110f471 (patch) | |
tree | c8f1a2efbc55886a6ab5a66ea569677aa150d9d4 /src | |
parent | 39df24a3f02495e5ef6bb5ea8ce029a2c1e377e6 (diff) | |
download | sqlite-1d7d8c8f74b44fb54fb15539a4191ea68110f471.tar.gz sqlite-1d7d8c8f74b44fb54fb15539a4191ea68110f471.zip |
Add the SQLITE_FCNTL_CKPT_DONE file-control for the use of custom VFSs.
FossilOrigin-Name: 3cc39e5069c8a6a32ecc49c571593615c0f347cadcd3e0325b7f9a11ddc1f546
Diffstat (limited to 'src')
-rw-r--r-- | src/sqlite.h.in | 7 | ||||
-rw-r--r-- | src/wal.c | 4 |
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 @@ -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; } } |