stephan [Mon, 7 Nov 2022 13:06:20 +0000 (13:06 +0000)]
Add sqlite3.wasm.alloc.impl() as a "public back door" into the low-level non-throwing allocator. Correct sqlite3.WasmAllocError constructor to behave like its usages expect it to and add tests for that.
drh [Mon, 7 Nov 2022 11:19:28 +0000 (11:19 +0000)]
Fix the documentation regarding negative length parameters for
sqlite3_result_text() interfaces, to point out that the length parameter
to sqlite3_result_text64() cannot be negative.
[forum:/forumpost/cf1d043b07|Forum post cf1d043b07].
Comment/documentation change only.
drh [Sun, 6 Nov 2022 17:19:34 +0000 (17:19 +0000)]
The recoverAssertMutexHeld() function is for testing and verification only
and should be a harmless no-op for production builds.
[forum/forumpost/b4f2c7d402|Forum post b4f2c7d402].
drh [Fri, 4 Nov 2022 11:54:42 +0000 (11:54 +0000)]
Enhance the ability of the OP_Found and similar opcodes to detect truncated
index records and report SQLITE_CORRUPT.
dbsqlfuzz 2b12f90aeff8e081706c7e9b58834f04869f446c. Test cases in TH3.
stephan [Thu, 3 Nov 2022 22:51:20 +0000 (22:51 +0000)]
Add experimental esm target to ext/wasm/GNUmakefile to tell emcc to generate sqlite3.mjs (ES6 module) instead of sqlite3.js. Related to discussion at [forum:ed4596cf8496a39b].
stephan [Wed, 2 Nov 2022 11:53:31 +0000 (11:53 +0000)]
Add sqlite3_wasm_vfs_create_file() to replace Emscripten's FS.createDataFile() in a (mostly) VFS-agnostic way. Add a test for worker1's export (to bytearray) support. Re-add worker1 open-from-bytearray using sqlite3_wasm_vfs_create_file() but it's untested (requires a new interactive test app or maybe reconsideration).
drh [Tue, 1 Nov 2022 12:10:39 +0000 (12:10 +0000)]
Enforce affinity on materialized tables for subqueries and views. Also,
do not allow UNION ALL flattening if the affinity of a result column varies
between different arms of the compound. This is a fix for
ticket [57c47526c34f01e8].
drh [Tue, 1 Nov 2022 12:01:10 +0000 (12:01 +0000)]
Improvements to comments. Change the "optimization_control" TCL command
in the test harness so that it returns the new optimization mask, for
verification.
drh [Mon, 31 Oct 2022 18:01:05 +0000 (18:01 +0000)]
Make the UPDATE method of the sqlite_dbpage virtual table rebust against
OOM errors. [forum:/forumpost/bbcf0dd6ca|Forum post bbcf0dd6ca]. Test case
in TH3.
stephan [Mon, 31 Oct 2022 13:50:05 +0000 (13:50 +0000)]
Worker1: use a list, rather than a single slot, to manage the default db link so that we can keep the least-recently-opened db as the default. Re-introduce worker1.export() but do not yet expose it until an equivalent import() (or open() option) is implemented.
stephan [Mon, 31 Oct 2022 11:09:14 +0000 (11:09 +0000)]
Add oo1.DB.exec() 'returnValue' option, which specifies what exec() should return. Defaults to the db object and enables direct return of the result rows array or a list of the individual SQL statements. Other code-adjacent internal cleanups.
stephan [Sun, 30 Oct 2022 09:47:33 +0000 (09:47 +0000)]
Minor WASM build cleanups. Enable custom Module.instantiateWasm() when not in WASMFS mode (where it doesn't work). Add sqlite3.debugModule URL param to enable some module-init-time debugging output.
stephan [Sun, 30 Oct 2022 08:39:18 +0000 (08:39 +0000)]
Reduce wasm module's starting memory from 128mb to 16mb. The latter value is needed only for WASMFS-based batch-runner.js, as WASMFS builds cannot be configured for dynamic memory growth without a tremendous performance hit.
stephan [Sat, 29 Oct 2022 07:54:10 +0000 (07:54 +0000)]
Move the sqlite3.capi.wasm namespace to sqlite3.wasm. This causes a tiny bit of naming confusion with the sqlite3.wasm *file*, but seems to make more sense than having it as a sub-namespace of capi.
drh [Thu, 27 Oct 2022 18:20:08 +0000 (18:20 +0000)]
In the CLI, ensure that input to utf8_width_print is not NULL, or if it is,
change it to an empty string. For for the problem reported by
[forum:/forumpost/2961cf13eec61876|forum post 2961cf13eec61876].
stephan [Thu, 27 Oct 2022 14:41:38 +0000 (14:41 +0000)]
speedtest1.html: when vfs==kvvfs, increase --size from 2 to 4, as enabled by [a4d40f6346e7]. --size 5 is 4.96mb out of (supposedly) 5mb, which works but is a bit too close to the edge.
stephan [Thu, 27 Oct 2022 03:56:01 +0000 (03:56 +0000)]
Restructure and simplify the feature-detection #defines of the recovery support in shell.c.in and disable it when building fiddle because it uses features we elide from the wasm build (e.g. utf16), leading to link errors.
stephan [Wed, 26 Oct 2022 15:40:17 +0000 (15:40 +0000)]
Correct misuse of localhost-mode-only symbol S in fiddle-worker.js, which should fix the outage reported in [forum:67d985ac0bbe407f|forum post 67d985ac0bbe407f].
stephan [Wed, 26 Oct 2022 11:27:33 +0000 (11:27 +0000)]
Replace the newly-removed oo1.DB.getFilename() with DB.dbFilename() with the hope that the distinction from the dbInstance.filename property is clearer.
stephan [Tue, 25 Oct 2022 15:38:38 +0000 (15:38 +0000)]
speedtest1: use the current (or default) vfs->xDelete method to unlink the db. This is specifically necessary when running the opfs vfs in a wasm build of speedtest1. This worked without this fix until recently because the affected test code was performing similar acrobatics in its stead.
drh [Tue, 25 Oct 2022 13:44:18 +0000 (13:44 +0000)]
Enhance the sqlite3_strglob() and sqlite3_strlike() interfaces so that they
will do sensible things with NULL string pointers. This is an extra layer
of defense against bugs such as reported by
[forum:/forumpost/730b554179|forum post 730b554179].
stephan [Tue, 25 Oct 2022 08:15:57 +0000 (08:15 +0000)]
Remove persistence from the 'reverse log order?' checkbox in tester1.js to eliminate an inconsistency between the main-thread and worker-thread modes (the latter having no option for persistence of that setting).