aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2023-09-01 11:05:22 +0000
committerstephan <stephan@noemail.net>2023-09-01 11:05:22 +0000
commitf551aa4e8013e65a9c248510e8724e15f952607c (patch)
tree7b17f3e4a4150e18a13ea9721f02bf3cefee70e2 /ext/wasm/api
parent8628c10e2701a2e7538bcc201cb1f1e0f9f5caf3 (diff)
downloadsqlite-f551aa4e8013e65a9c248510e8724e15f952607c.tar.gz
sqlite-f551aa4e8013e65a9c248510e8724e15f952607c.zip
In the OPFS VFS' importDb() methods, overwrite the header bytes 18 and 19 with 1 instead of 0. Both seem to work, but 1 is correct.
FossilOrigin-Name: 1c532e807bf8466b67d9600ab9630a6736de77259e9a71ac435641715ee0e04b
Diffstat (limited to 'ext/wasm/api')
-rw-r--r--ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js2
-rw-r--r--ext/wasm/api/sqlite3-vfs-opfs.c-pp.js2
2 files changed, 2 insertions, 2 deletions
diff --git a/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js b/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js
index 8e874f728..1d2b39589 100644
--- a/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js
+++ b/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js
@@ -895,7 +895,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
sah.read( header, {at: 0} );
util.affirmDbHeader( header );
}
- sah.write(new Uint8Array(2), {
+ sah.write(new Uint8Array([1,1]), {
at: HEADER_OFFSET_DATA + 18
}/*force db out of WAL mode*/);
}catch(e){
diff --git a/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js b/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js
index ca2fde985..4525ef548 100644
--- a/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js
+++ b/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js
@@ -1197,7 +1197,7 @@ const installOpfsVfs = function callee(options){
sah.read( header, {at: 0} );
util.affirmDbHeader( header );
}
- sah.write(new Uint8Array(2), {at: 18}/*force db out of WAL mode*/);
+ sah.write(new Uint8Array([1,1]), {at: 18}/*force db out of WAL mode*/);
return nWrote;
}catch(e){
await sah.close();