1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-01-06 08:01:16 +03:00

Fix a problem causing the rbu_exclusive_checkpoint=1 to be ignored with zipvfs databases.

FossilOrigin-Name: d8f50b31e8d64fce5141da4a016767a15482703364692a55df346f059fc9d30c
This commit is contained in:
dan
2023-04-07 14:03:30 +00:00
parent 1e24f9f1f3
commit 6d47af64e4
3 changed files with 17 additions and 8 deletions

View File

@@ -3141,6 +3141,11 @@ static void rbuCheckpointFrame(sqlite3rbu *p, RbuFrame *pFrame){
p->rc = pDb->pMethods->xWrite(pDb, p->aBuf, p->pgsz, iOff);
}
/*
** This value is copied from the definition of ZIPVFS_CTRL_FILE_POINTER
** in zipvfs.h.
*/
#define RBU_ZIPVFS_CTRL_FILE_POINTER 230439
/*
** Take an EXCLUSIVE lock on the database file. Return SQLITE_OK if
@@ -3149,7 +3154,11 @@ static void rbuCheckpointFrame(sqlite3rbu *p, RbuFrame *pFrame){
static int rbuLockDatabase(sqlite3 *db){
int rc = SQLITE_OK;
sqlite3_file *fd = 0;
sqlite3_file_control(db, "main", SQLITE_FCNTL_FILE_POINTER, &fd);
sqlite3_file_control(db, "main", RBU_ZIPVFS_CTRL_FILE_POINTER, &fd);
if( fd==0 ){
sqlite3_file_control(db, "main", SQLITE_FCNTL_FILE_POINTER, &fd);
}
if( fd->pMethods ){
rc = fd->pMethods->xLock(fd, SQLITE_LOCK_SHARED);