1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

OPFS VFS: change the xCheckReservedLock() impl to always return false, as discussed in [forum:a2f573b00cda1372|forum thread a2f573b00cda1372]. This does not impact any current tests, and may have no direct impact at all because of how that VFS handles locking, but is hypothetically a more correct solution than the previous one.

FossilOrigin-Name: c298b8ba2dcd01fa28b79a78bb4986fa0282755a0a36b7f38b93096ac31f521e
This commit is contained in:
stephan
2024-06-12 12:36:02 +00:00
parent 01f07a61e4
commit fd70ca40cc
3 changed files with 21 additions and 11 deletions

View File

@@ -715,12 +715,23 @@ const installOpfsVfs = function callee(options){
file. We have no way of checking whether any _other_ db
connection has a lock except by trying to obtain and (on
success) release a sync-handle for it, but doing so would
involve an inherent race condition. For the time being,
involve an inherent race condition and would require
waiting on the async proxy (which might be tied up for
arbitrarily long with unrelated work). For the time being,
pending a better solution, we simply report whether the
given pFile is open.
Update 2024-06-12: based on forum discussions, this
function now always sets pOut to 0 (false):
https://sqlite.org/forum/forumpost/a2f573b00cda1372
*/
const f = __openFiles[pFile];
wasm.poke(pOut, f.lockType ? 1 : 0, 'i32');
if(1){
wasm.poke(pOut, 0, 'i32');
}else{
const f = __openFiles[pFile];
wasm.poke(pOut, f.lockType ? 1 : 0, 'i32');
}
return 0;
},
xClose: function(pFile){
@@ -736,7 +747,6 @@ const installOpfsVfs = function callee(options){
return rc;
},
xDeviceCharacteristics: function(pFile){
//debug("xDeviceCharacteristics(",pFile,")");
return capi.SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN;
},
xFileControl: function(pFile, opId, pArg){