diff options
author | stephan <stephan@noemail.net> | 2025-03-14 11:14:52 +0000 |
---|---|---|
committer | stephan <stephan@noemail.net> | 2025-03-14 11:14:52 +0000 |
commit | 5390f95f071ae83d2d89742b7a94ec1bfec6f6ff (patch) | |
tree | 3eba9019d68ded8463afa908365f262326ede5d9 /ext/wasm/api | |
parent | 69eaadbee3dc5912aba995288bfb20eeeb1222e6 (diff) | |
parent | 1560045c328e5dc3b9a09e9c975b8626f984ef4f (diff) | |
download | sqlite-5390f95f071ae83d2d89742b7a94ec1bfec6f6ff.tar.gz sqlite-5390f95f071ae83d2d89742b7a94ec1bfec6f6ff.zip |
Minor doc corrections for the sahpool-digest fix and merge in current trunk.
FossilOrigin-Name: 500f2e6ec74b4c0e4ac0365ba4e0d81ed6df8dd09dc0f8af65d294c3453f8865
Diffstat (limited to 'ext/wasm/api')
-rw-r--r-- | ext/wasm/api/sqlite3-api-glue.c-pp.js | 2 | ||||
-rw-r--r-- | ext/wasm/api/sqlite3-api-prologue.js | 8 | ||||
-rw-r--r-- | ext/wasm/api/sqlite3-opfs-async-proxy.js | 4 | ||||
-rw-r--r-- | ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js | 18 | ||||
-rw-r--r-- | ext/wasm/api/sqlite3-wasm.c | 10 |
5 files changed, 22 insertions, 20 deletions
diff --git a/ext/wasm/api/sqlite3-api-glue.c-pp.js b/ext/wasm/api/sqlite3-api-glue.c-pp.js index a40b83282..a38b9cb5e 100644 --- a/ext/wasm/api/sqlite3-api-glue.c-pp.js +++ b/ext/wasm/api/sqlite3-api-glue.c-pp.js @@ -1835,7 +1835,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ if(!(tgt instanceof StructBinder.StructType)){ toss("Usage error: target object is-not-a StructType."); }else if(!(func instanceof Function) && !wasm.isPtr(func)){ - toss("Usage errror: expecting a Function or WASM pointer to one."); + toss("Usage error: expecting a Function or WASM pointer to one."); } if(1===arguments.length){ return (n,f)=>callee(tgt, n, f, applyArgcCheck); diff --git a/ext/wasm/api/sqlite3-api-prologue.js b/ext/wasm/api/sqlite3-api-prologue.js index 973d7e49b..719e307e8 100644 --- a/ext/wasm/api/sqlite3-api-prologue.js +++ b/ext/wasm/api/sqlite3-api-prologue.js @@ -124,7 +124,7 @@ globalThis.sqlite3ApiBootstrap = function sqlite3ApiBootstrap( apiConfig = (globalThis.sqlite3ApiConfig || sqlite3ApiBootstrap.defaultConfig) ){ - if(sqlite3ApiBootstrap.sqlite3){ /* already initalized */ + if(sqlite3ApiBootstrap.sqlite3){ /* already initialized */ (sqlite3ApiBootstrap.sqlite3.config || console).warn( "sqlite3ApiBootstrap() called multiple times.", "Config and external initializers are ignored on calls after the first." @@ -869,7 +869,7 @@ globalThis.sqlite3ApiBootstrap = function sqlite3ApiBootstrap( Emscripten -sWASM_BIGINT flag, else false. When enabled, certain 64-bit sqlite3 APIs are enabled which are not otherwise enabled due to JS/WASM int64 - impedence mismatches. + impedance mismatches. */ bigIntEnabled: !!config.bigIntEnabled, /** @@ -880,7 +880,7 @@ globalThis.sqlite3ApiBootstrap = function sqlite3ApiBootstrap( /** When Emscripten compiles with `-sIMPORTED_MEMORY`, it - initalizes the heap and imports it into wasm, as opposed to + initializes the heap and imports it into wasm, as opposed to the other way around. In this case, the memory is not available via this.exports.memory. */ @@ -1555,7 +1555,7 @@ globalThis.sqlite3ApiBootstrap = function sqlite3ApiBootstrap( - "memdb": results are undefined. - "kvvfs": will fail with an I/O error due to strict internal - requirments of that VFS's xTruncate(). + requirements of that VFS's xTruncate(). - "unix" and related: will use the WASM build's equivalent of the POSIX I/O APIs. This will work so long as neither a specific diff --git a/ext/wasm/api/sqlite3-opfs-async-proxy.js b/ext/wasm/api/sqlite3-opfs-async-proxy.js index 0028c1025..e10d0dd50 100644 --- a/ext/wasm/api/sqlite3-opfs-async-proxy.js +++ b/ext/wasm/api/sqlite3-opfs-async-proxy.js @@ -61,7 +61,7 @@ const installAsyncProxy = function(){ } /** - Will hold state copied to this object from the syncronous side of + Will hold state copied to this object from the synchronous side of this API. */ const state = Object.create(null); @@ -722,7 +722,7 @@ const installAsyncProxy = function(){ https://github.com/tomayac/sqlite-wasm/issues/12 - is reporting that this occassionally, under high loads, + is reporting that this occasionally, under high loads, returns 'ok', which leads to the whichOp being 0 (which isn't a valid operation ID and leads to an exception, along with a corresponding ugly console log 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 81bbcf3c5..f30df3198 100644 --- a/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js +++ b/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js @@ -83,11 +83,11 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ /* Part of the fix for https://github.com/sqlite/sqlite-wasm/issues/97 - Summary: prior to versions 3.49.2 and 3.50.0 computeDigest() - always computes a value of [0,0] due to overflows, so it does not - do anything useful. Fixing it invalidates old persistent files, - so we instead only fix it for files created or updated since the - bug was discovered and fixed. + Summary: prior to version 3.50.0 computeDigest() always computes + a value of [0,0] due to overflows, so it does not do anything + useful. Fixing it invalidates old persistent files, so we + instead only fix it for files created or updated since the bug + was discovered and fixed. This flag determines whether we use the broken legacy computeDigest() or the v2 variant. We only use this flag for @@ -97,7 +97,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ What this means, in terms of db file compatibility between versions: - - DBs created with versions older than this fix (<=3.49.1) + - DBs created with versions older than this fix (<3.50.0) can be read by post-fix versions. Such DBs which are written to in-place (not replaced) by newer versions can still be read by older versions, as the affected digest is only modified @@ -110,7 +110,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ entry is missing the FLAG_COMPUTE_DIGEST_V2 bit so will treat it as a legacy file. - This flag is stored in the same memory as the variour + This flag is stored in the same memory as the various SQLITE_OPEN_... flags and we must be careful here to not use a flag bit which is otherwise relevant for the VFS. SQLITE_OPEN_MEMORY is handled by sqlite3_open_v2() and friends, @@ -1163,7 +1163,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ - `clearOnInit`: (default=false) if truthy, contents and filename mapping are removed from each SAH it is acquired during - initalization of the VFS, leaving the VFS's storage in a pristine + initialization of the VFS, leaving the VFS's storage in a pristine state. Use this only for databases which need not survive a page reload. @@ -1290,7 +1290,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ VFS-hosted database file. The result of the resolved Promise when called this way is the size of the resulting database. - On succes this routine rewrites the database header bytes in the + On success this routine rewrites the database header bytes in the output file (not the input array) to force disabling of WAL mode. On a write error, the handle is removed from the pool and made diff --git a/ext/wasm/api/sqlite3-wasm.c b/ext/wasm/api/sqlite3-wasm.c index 4af52a969..d9f0f08eb 100644 --- a/ext/wasm/api/sqlite3-wasm.c +++ b/ext/wasm/api/sqlite3-wasm.c @@ -128,7 +128,9 @@ #endif #ifdef SQLITE_WASM_EXTRA_INIT -# define SQLITE_EXTRA_INIT sqlite3_wasm_extra_init +/* SQLITE_EXTRA_INIT vs SQLITE_EXTRA_INIT_MUTEXED: +** see https://sqlite.org/forum/forumpost/14183b98fc0b1dea */ +# define SQLITE_EXTRA_INIT_MUTEXED sqlite3_wasm_extra_init #endif /* @@ -284,7 +286,7 @@ SQLITE_WASM_EXPORT void * sqlite3__wasm_stack_alloc(int n){ /* ** State for the "pseudo-stack" allocator implemented in ** sqlite3__wasm_pstack_xyz(). In order to avoid colliding with -** Emscripten-controled stack space, it carves out a bit of stack +** Emscripten-controlled stack space, it carves out a bit of stack ** memory to use for that purpose. This memory ends up in the ** WASM-managed memory, such that routines which manipulate the wasm ** heap can also be used to manipulate this memory. @@ -311,7 +313,7 @@ SQLITE_WASM_EXPORT void * sqlite3__wasm_pstack_ptr(void){ return PStack.pPos; } /* -** Sets the pstack position poitner to p. Results are undefined if the +** Sets the pstack position pointer to p. Results are undefined if the ** given value did not come from sqlite3__wasm_pstack_ptr(). */ SQLITE_WASM_EXPORT void sqlite3__wasm_pstack_restore(unsigned char * p){ @@ -1417,7 +1419,7 @@ int sqlite3__wasm_db_serialize( sqlite3 *pDb, const char *zSchema, ** NULL), or nData is negative, SQLITE_MISUSE are returned. ** ** On success, it creates a new file with the given name, populated -** with the fist nData bytes of pData. If pData is NULL, the file is +** with the first nData bytes of pData. If pData is NULL, the file is ** created and/or truncated to nData bytes. ** ** Whether or not directory components of zFilename are created |