mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
Correct OPFS VFS xRead() to copy the result buffer if the result code is SQLITE_IOERR_SHORT_READ.
FossilOrigin-Name: 56668f9902c6e896b6c63621a444444c6f58ee20f88a5feae97f1699be35892d
This commit is contained in:
@ -386,9 +386,10 @@ sqlite3.installOpfsVfs = function callee(asyncProxyUri = callee.defaultProxyUri)
|
||||
try {
|
||||
// FIXME(?): block until we finish copying the xRead result buffer. How?
|
||||
rc = opRun('xRead',{fid:pFile, n, offset});
|
||||
if(0!==rc) return rc;
|
||||
let i = 0;
|
||||
for(; i < n; ++i) wasm.setMemValue(pDest + i, f.sabView[i]);
|
||||
if(0===rc || capi.SQLITE_IOERR_SHORT_READ===rc){
|
||||
let i = 0;
|
||||
for(; i < n; ++i) wasm.setMemValue(pDest + i, f.sabView[i]);
|
||||
}
|
||||
}catch(e){
|
||||
error("xRead(",arguments,") failed:",e,f);
|
||||
rc = capi.SQLITE_IOERR_READ;
|
||||
|
Reference in New Issue
Block a user