drh [Thu, 22 Jan 2026 19:02:32 +0000 (19:02 +0000)]
Enhance the [/info/e33da6d5dc964db8|EXISTS-to-JOIN optimization] so that
the inserted JOIN terms are not required to be on the inner-most loops,
as long as all dependencies for the EXISTS-to-JOIN loops are in outer
loops. This addresses the performance concern of
[forum:/forumpost/2026-01-21T19:49:04z|forum post 2026-01-21T19:49:04z].
Test cases in TH3.
drh [Wed, 21 Jan 2026 19:24:07 +0000 (19:24 +0000)]
Add a new encoding constant SQLITE_UTF8_ZT, which if used with
sqlite3_result_text64() or sqlite3_bind_text64() declares that the
string provided is UTF8 and zero-terminated at the length specified.
stephan [Tue, 20 Jan 2026 17:10:22 +0000 (17:10 +0000)]
wasm: a potential workaround for cases such as [forum:1eec339854c935bd|forum post 1eec339854c935bd], where client-local needs require overriding Emscripten config defaults (which we very intentionally do not document or support for reasons explained in that thread). This is untested because it requires a special-needs setup, but it doesn't break anything for run-of-the-mill cases.
drh [Mon, 19 Jan 2026 11:44:59 +0000 (11:44 +0000)]
Add two new JSON functions: json_array_insert() and jsonb_array_insert().
Patterned after the json_array_insert() function of MySQL.
[forum:/forumpost/2026-01-17T10:40:39z|Forum thread 2026-01-17T10:40:39z].
drh [Sat, 17 Jan 2026 14:23:28 +0000 (14:23 +0000)]
Add new SQL function: json_array_insert(). Suggested in
[forum:/forumpost/2026-01-17T10:40:39z|forum thread 2026-01-17T10:40:39z].
This check-in seems to work, but contains no test cases. Also, no error
is raised if the PATH does not reference an array. Prototype only.
drh [Fri, 16 Jan 2026 15:53:20 +0000 (15:53 +0000)]
The optimization at [8bdda827a3d26800] is incorrect for the case where one
of the two expressions has been commuted such that the collating sequence
has changed. This check-in fixes the problem. Problem reported by
[forum:/forumpost/2026-01-16T11:35:28Z|forum post 2026-01-16T11:35:28Z].
drh [Tue, 13 Jan 2026 02:35:19 +0000 (02:35 +0000)]
Fix integer overflow problems and error reporting memory leaks in
the zipfile extension.
[forum:/forumpost/2026-01-13T00:09:06Z|Forum post 2026-01-13T00:09:06Z].
drh [Mon, 12 Jan 2026 19:56:00 +0000 (19:56 +0000)]
Avoid unsigned integer overflow in the delta_apply() extension function.
Not part of any standard deliverable.
[forum:/forumpost/d41879b367c7f7ec|Forum thread d41879b367c7f7ec].
stephan [Sun, 11 Jan 2026 14:14:16 +0000 (14:14 +0000)]
wasm: add @preserve tags to two comment blocks (license header and build version info) so that the npm tools know to retain those comments when minifying.
stephan [Fri, 9 Jan 2026 19:44:31 +0000 (19:44 +0000)]
Add the 'npm' ext/wasm makefile target to create npm-bundle.zip for use by the downstream npm package. This target is intended to become their path for pulling npm-relevant deliverables, rather than the canonical downloads, and they have our/my commitment not to break it without involving them first.
drh [Fri, 9 Jan 2026 00:41:35 +0000 (00:41 +0000)]
Fix potential OOB read on the undocumented test function rtreenode() that
is part of the RTREE extension, as described in
[forum:/forumpost/2026-01-08T23:32:19Z|forum post 2026-01-08T23:32:19Z].
The problem is almost certainly harmless since any memory allocation will
be a multiple of 8 bytes, and once the input buffer size gets rounded up to
the next multiple of 8 bytes, the access will still be within bounds.
Nevertheless, it still needs to be fixed.
drh [Thu, 8 Jan 2026 20:29:02 +0000 (20:29 +0000)]
Enhance VACUUM INTO so that if a URI filename is used as the target and that
filename as a reserve=N query parameter with N between 0 and 255, then the
reserve amount for the generated database copy is set to N. This simplifies
making a copy of a database file with a reduced or reset reserve.
stephan [Thu, 8 Jan 2026 18:15:23 +0000 (18:15 +0000)]
Fix the sqlite3-worker1.mjs (ESM, non-bundler) build and have demo-worker1-promiser use that file rather than the vanilla one, as a test case. Delete the global symbol installed by that file in ESM and bundler builds, as it's unnecessary there. The first change should resolve [https://github.com/sqlite/sqlite-wasm/issues/123|downstream sqlite-wasm/issues/123], with thanks to Jure Rotar for his help.
drh [Thu, 8 Jan 2026 13:43:15 +0000 (13:43 +0000)]
Enhance the --vfs command-line option to the CLI such that if the argument
is not a valid VFS name, but is the name of a file, attempt to load that
file as an extension, which presumably adds the desired VFS.
drh [Thu, 8 Jan 2026 12:39:49 +0000 (12:39 +0000)]
Do not show LIKE wildcards on table names in the output of the ".schema"
command in the CLI.
[forum:/info/6ebb57b41691293d|Forum post 6ebb57b41691293d].
drh [Thu, 8 Jan 2026 12:22:50 +0000 (12:22 +0000)]
Add the showtmlog utility for decoding the tmstmpvfs log files.
Fix tmstmpvfs so that it records timestamps in milliseconds since the
Unix epoch, not in JDN milliseconds.
drh [Thu, 8 Jan 2026 01:37:13 +0000 (01:37 +0000)]
Improve showdb so that it does a better job of handling reserve-bytes.
Add the --tmstmp option that causes pgidx to interpret tmstmpvfs tags
if they are available.
drh [Wed, 7 Jan 2026 21:19:42 +0000 (21:19 +0000)]
Enhance the VACUUM INTO command such that if the target file is a URI
with a reserve=N query parameter, then the reserve_bytes value is set to
N provided that N is within the allowed range. This can even reduce the
size of the reserve, all the way to zero. This provides a way to remove
reserve from a database without having to do a complete dump/restore.
drh [Wed, 7 Jan 2026 18:45:23 +0000 (18:45 +0000)]
Improvements to logging. Better log-file names. Log files are in a
subdirectory named after the database. Only connections that write to
the database create logs. Better documentation in the header comment.
drh [Mon, 5 Jan 2026 17:28:33 +0000 (17:28 +0000)]
Add the experimental tmstmpvfs.c extension that adds a timestamp and other
debugging information on each page of a database as that page is written,
if the database is configured for exactly 16 bytes of reserve space.
drh [Sat, 3 Jan 2026 15:11:07 +0000 (15:11 +0000)]
Fix yet another bug in the [/info/e33da6d5dc964db8|EXISTS-to-JOIN]
optimization, reported by
[forum:/forumpost/2026-01-03T14:05:48z|forum post 2026-01-03T14:05:48z].
dan [Fri, 2 Jan 2026 17:10:40 +0000 (17:10 +0000)]
Ensure that loops created by the exists-to-join optimization use unique cursor numbers, even if the EXISTS expression in the WHERE clause is a copy of an expression from the result-set of the SELECT. dbsqlfuzz 4f6a5213cf74fcf2a8a3e48abc2333100348c38e.
drh [Wed, 31 Dec 2025 20:35:16 +0000 (20:35 +0000)]
The header setting from the legacy ".headers" dot-command takes precedence
over the current ".mode" setting, for backwards compatibility.
[forum:/forumpost/2025-12-31T19:14:24z|Forum post 2025-12-31T19:14:24z].
drh [Wed, 31 Dec 2025 19:45:45 +0000 (19:45 +0000)]
In the (completely unused, as far as I know) btreeinfo.c extension (not
a part of any standard build) do a better job of detecting corrupt database
files and provide better error messages when corruption is detected.
[forum:/forumpost/e66a458339|Forum post e66a458339].
drh [Wed, 31 Dec 2025 17:21:30 +0000 (17:21 +0000)]
Add the new "retest" command to testrunner.tcl, which reruns any tests that
failed or never completed in the previous invocation. New makefile target
"retest" for both unix and Windows that runs testrunner.tcl with "retest".
drh [Wed, 31 Dec 2025 01:19:51 +0000 (01:19 +0000)]
Use sqlite3_malloc64() in all places in the compress.c extension to avoid
integer overflow.
[forum:/forumpost/2025-12-31T01:04:00z|Forum post 2025-12-31T01:04:00z].
drh [Wed, 31 Dec 2025 01:01:14 +0000 (01:01 +0000)]
Fix a typo in [0819fe670f9ceec7] that lead to incomplete protection against
buffer overflow in the zipfile extension.
[forum:/forumpost/2025-12-30T23:57:19z|Forum post 2025-12-30T23:57:19z]
drh [Mon, 29 Dec 2025 12:34:37 +0000 (12:34 +0000)]
Fix the "testfixture" makefile target so that it builds with a static TCL
library on Mac-ARM. Fix the "tool-zip" target so that it uses ordinary
tclsh rather than testfixture to run the tool/mmktoolzip.tcl script that
builds the archive.
drh [Sun, 28 Dec 2025 14:32:28 +0000 (14:32 +0000)]
If the filename argument to the .import command is of the form
"<<endmark" then the content is read from the script (or stdin) until
the first line that begins with "endmark".