Index: src/main.c ================================================================== --- src/main.c +++ src/main.c @@ -1779,18 +1779,22 @@ int sqlite3_ckpt_open( sqlite3 *db, unsigned char *a, int n, sqlite3_ckpt **ppCkpt ){ - Pager *pPager; - Btree *pBt; + Pager *pPager = 0; int rc; *ppCkpt = 0; sqlite3_mutex_enter(db->mutex); - pBt = db->aDb[0].pBt; - pPager = sqlite3BtreePager(pBt); + + /* Find the Pager object. */ + rc = sqlite3_file_control(db,"main",SQLITE_FCNTL_ZIPVFS_PAGER,(void*)&pPager); + if( rc!=SQLITE_OK ){ + pPager = sqlite3BtreePager(db->aDb[0].pBt); + } + rc = sqlite3PagerWalCheckpointStart(db, pPager, a, n, ppCkpt); sqlite3_mutex_leave(db->mutex); return rc; } Index: src/sqlite.h.in ================================================================== --- src/sqlite.h.in +++ src/sqlite.h.in @@ -939,10 +939,14 @@ ** The [SQLITE_FCNTL_WIN32_SET_HANDLE] opcode is used for debugging. This ** opcode causes the xFileControl method to swap the file handle with the one ** pointed to by the pArg argument. This capability is used during testing ** and only needs to be supported when SQLITE_TEST is defined. ** +**
  • [[SQLITE_FCNTL_ZIPVFS_PAGER]] +** The [SQLITE_FCNTL_ZIPVFS_PAGER] opcode is used by the OTA extension when +** updating a zipvfs database. +** ** */ #define SQLITE_FCNTL_LOCKSTATE 1 #define SQLITE_GET_LOCKPROXYFILE 2 #define SQLITE_SET_LOCKPROXYFILE 3 @@ -963,10 +967,11 @@ #define SQLITE_FCNTL_TRACE 19 #define SQLITE_FCNTL_HAS_MOVED 20 #define SQLITE_FCNTL_SYNC 21 #define SQLITE_FCNTL_COMMIT_PHASETWO 22 #define SQLITE_FCNTL_WIN32_SET_HANDLE 23 +#define SQLITE_FCNTL_ZIPVFS_PAGER 24 /* ** CAPI3REF: Mutex Handle ** ** The mutex module within SQLite defines [sqlite3_mutex] to be an