stephan [Tue, 27 Jan 2026 16:15:22 +0000 (16:15 +0000)]
Teach sqlite3_rsync to increment its error count when a child process fails, based on [forum:8fe404e547faa42e|forum post 8fe404e547faa42e]. This passes basic sanity tests but requires more testing and needs a review of the final 'else' block in the new code.
drh [Mon, 26 Jan 2026 21:20:28 +0000 (21:20 +0000)]
Enhancements to tmstmpvfs.c: (1) Use the exact same timestamp on logfile
entries as on the pages that control, where appropriate. (2) Include the
WAL frame number in ELOG_CKPT_PAGE logfile entries.
drh [Sun, 25 Jan 2026 15:18:31 +0000 (15:18 +0000)]
Fix the jsonb_group_array() and jsonb_group_object() functions so that they return
JSONB as they should, and not text JSON, when the array or object is empty.
[forum:/forumpost/2026-01-25T00:47:06z|Forum post 2026-01-25T00:47:06z].
drh [Sat, 24 Jan 2026 17:18:56 +0000 (17:18 +0000)]
Assert() statements added to sqlite3_result_text64() and
sqlite3_bind_text64() to detect misuse of SQLITE_UTF8_ZT that can
result in undefined behavior.
stephan [Sat, 24 Jan 2026 01:17:06 +0000 (01:17 +0000)]
Expose SQLITE_UTF_ZT to WASM for completeness's sake, but the WASM build does not expose sqlite3_bind_text64() or sqlite3_result_text64() because it only supports UTF8 encoding, so ZT does not currently have a genuine use there.
drh [Fri, 23 Jan 2026 20:46:54 +0000 (20:46 +0000)]
In the cost metrics of the query planner, the estimated number of output rows
from an EXISTS-to-JOIN loop should not be more than 1.
[forum:/forumpost/989880d0aa|Forum post 989880d0aa].
drh [Fri, 23 Jan 2026 00:55:36 +0000 (00:55 +0000)]
Add the SQLITE_UTF8_ZT value which can be the encoding argument to
sqlite3_result_text64() or sqlite3_bind_test64() to indicate that the
argument is UTF-8 text that is zero-terminated.
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 19:51:03 +0000 (19:51 +0000)]
Be more aggressive about using a sort-and-merge to compute the UNION of
two SELECT statements. Experimental branch. This check-in is failing some
tests.
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.