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].
drh [Wed, 19 Oct 2022 11:58:24 +0000 (11:58 +0000)]
Fix references to "SrcList_item" in comments as that object has since
[bfd5bf2c73110fcb] (2021-02-21) been called "SrcItem". Comment changes
only. No changes to code.
drh [Wed, 19 Oct 2022 10:56:05 +0000 (10:56 +0000)]
If a query uses an index where one or more of the columns of the index is
an expression or a virtual column, and if the corresponding expression is
used elsewhere in the query, then strive to read the value of the expression
out of the index, rather than recomputing it. This is the
"Indexed Expression Optimizations".
stephan [Wed, 19 Oct 2022 06:06:42 +0000 (06:06 +0000)]
Update the dist rules for this evening's js/wasm build changes and include an index.html specifically for the subset of apps included in the dist archive.
stephan [Wed, 19 Oct 2022 04:44:58 +0000 (04:44 +0000)]
Apply considerable acrobatics to get the JS/WASM deliverables building to and loadable from a directory other than the one which contains the app-level code. Requires an only-slightly-leaky abstraction of passing a URL argument when loading sqlite3.js but provides much greater flexibility in where the JS/WASM files are located.
stephan [Wed, 19 Oct 2022 01:07:30 +0000 (01:07 +0000)]
Considerable wasm/js build cleanups and reworking. Remove wasmfs builds from the end-user deliverables and disable the wasmfs build by default, per /chat discussion, as it doubles our deliverable count for only marginal gain. Attempt to move the sqlite3.js/wasm files into subdirectories but rediscovered that that breaks loading in Worker mode because URI resolution of the wasm files differs depending on whether the main script is loaded from a script tag or a Worker.
drh [Tue, 18 Oct 2022 22:37:07 +0000 (22:37 +0000)]
If a virtual column whose value is constant gets indexed, do not include
that column in the IndexedExpr list.
dbsqlfuzz 59ac17a99b9a5c4930ee71cc153c9428a0c0e794
drh [Tue, 18 Oct 2022 10:27:06 +0000 (10:27 +0000)]
Fix sqlite3VdbeRecordCompareWithSkip() so that it sorts the internal-use
serial-type of 10 together with NULLs.
dbsqlfuzz 5ff35e9d49a5fcca5051e23960ff2f483a538bab
stephan [Mon, 17 Oct 2022 16:47:59 +0000 (16:47 +0000)]
Repair version-info.c after a local mishap caused all of the intended edits from [36e197cb3d0c]/[e9b407a4d0a0] to get deleted before checkin. Simplify version-info build (only requires sqlite3.h, not the library).
drh [Mon, 17 Oct 2022 16:09:33 +0000 (16:09 +0000)]
Fix a potential call to strlen() with a null argument in the command-line shell
following an OOM error. [forum:/forumpost/9c4f2ebe22|forum post 9c4f2ebe22].
stephan [Sun, 16 Oct 2022 18:50:55 +0000 (18:50 +0000)]
Add aggregate function support to sqlite3.oo1.DB.createFunction(). Change signature of the options object used by that function so that the callback property names match those of the corresponding C APIs.
dan [Fri, 14 Oct 2022 19:30:34 +0000 (19:30 +0000)]
Fix a problem with using the push-down optimization on compound SELECTs where component SELECTs use different collation sequences. dbsqlfuzz 11516f050100243e5a845f5a2b48a90ed2efaf2e.
dan [Fri, 14 Oct 2022 15:10:36 +0000 (15:10 +0000)]
Fix a problem in the LIKE and GLOB operators that may occur when the character immediately following a "%" or "*" wildcard is U+80. Reported by [forum:61bf7ccbdf].
drh [Thu, 13 Oct 2022 21:08:34 +0000 (21:08 +0000)]
This experimental branch attempts to use columns for an index-on-expression
in place of the expression that is being indexed. This particular check-in
mostly works, but there are still issues.
stephan [Thu, 13 Oct 2022 16:48:35 +0000 (16:48 +0000)]
Move the rest of testing1.js into tester1.js and eliminate the dependency on jaccwabyt_test.c. Extend the list of default config-related #defines in sqlite3-wasm.c and reorganize them for maintainability.