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).
drh [Mon, 24 Oct 2022 13:20:48 +0000 (13:20 +0000)]
Improve the ability of the query planner to recognize covering indexes even
on tables with more than 63 columns and where the index is over columns
beyond the 63rd column.
drh [Sat, 22 Oct 2022 14:16:02 +0000 (14:16 +0000)]
This branch attempts to improve the detection of covering indexes. This
first check-in merely improves a parameter name to sqlite3WhereBegin() to
be more descriptive of what it contains, and ensures that a subroutine is
not inlines so that sqlite3WhereBegin() runs slightly faster.
drh [Sat, 22 Oct 2022 13:49:35 +0000 (13:49 +0000)]
Clarification on the meaning of SrcList and SrcItem and especially the
SrcItem.colUsed and Index.colNotIdxed fields. Comment changes only - no
changes to code.
stephan [Fri, 21 Oct 2022 05:27:40 +0000 (05:27 +0000)]
Expose sqlite3_vfs_unregister() to WASM and unregister kvvfs in Worker threads to avoid its unintended use there (in contexts other than local/sessionStorage). Correct registration of window functions, extend oo1.DB.createFunction() to support window functions, and add window function tests to tester1.js. Correct an incorrect 1-arg handling case for DB.exec(). Add per-test assertion counts to tester1.js.
stephan [Thu, 20 Oct 2022 21:28:31 +0000 (21:28 +0000)]
Add more JS tests. Flesh out the aggregate UDF tests to use sqlite3_aggregate_context() so that they can each be used multiple times in the same statement. Add sqlite3_js_aggregate_context() convenience helper.
drh [Thu, 20 Oct 2022 16:12:02 +0000 (16:12 +0000)]
Only enable the bMaybeNullRow flag on IndexedExpr for an index on an
expression, not on a virtual column. But do enable it for the right operand
of a right join.
drh [Thu, 20 Oct 2022 13:36:32 +0000 (13:36 +0000)]
The generalized indexed expression optimization of [2435112867fbd7b6] makes
the prior [a47efb7c8520a011] enhancement from 2017 obsolete. This check-in
removes the older optimization.
drh [Wed, 19 Oct 2022 18:04:42 +0000 (18:04 +0000)]
In the CLI, never use strcmp() or strncmp() directly. Instead use
wrapper functions cli_strcmp() and cli_strncmp() that work correctly even
if the input is a NULL pointer.
[forum:/forumpost/142b868da7560d0b|Forum post 142b868da7560d0b].