mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
Fix the rbu_exclusive_checkpoint=1 option so that it works with a zipvfs database in pass-through mode.
FossilOrigin-Name: caca67d30670913914335aa3edff784e1c3d26aed70ae32efb5607ccf31ad142
This commit is contained in:
@ -3156,11 +3156,18 @@ static int rbuLockDatabase(sqlite3 *db){
|
||||
sqlite3_file *fd = 0;
|
||||
|
||||
sqlite3_file_control(db, "main", RBU_ZIPVFS_CTRL_FILE_POINTER, &fd);
|
||||
if( fd==0 ){
|
||||
if( fd ){
|
||||
sqlite3_file_control(db, "main", SQLITE_FCNTL_FILE_POINTER, &fd);
|
||||
rc = fd->pMethods->xLock(fd, SQLITE_LOCK_SHARED);
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = fd->pMethods->xUnlock(fd, SQLITE_LOCK_NONE);
|
||||
}
|
||||
sqlite3_file_control(db, "main", RBU_ZIPVFS_CTRL_FILE_POINTER, &fd);
|
||||
}else{
|
||||
sqlite3_file_control(db, "main", SQLITE_FCNTL_FILE_POINTER, &fd);
|
||||
}
|
||||
|
||||
if( fd->pMethods ){
|
||||
if( rc==SQLITE_OK && fd->pMethods ){
|
||||
rc = fd->pMethods->xLock(fd, SQLITE_LOCK_SHARED);
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = fd->pMethods->xLock(fd, SQLITE_LOCK_EXCLUSIVE);
|
||||
|
Reference in New Issue
Block a user