drh [Sun, 17 May 2026 17:18:12 +0000 (17:18 +0000)]
Fix the sqlite3_value_numeric_type() interface so that it works even if
the argument is an sqlite3_value object that came from sqlite3_value_dup().
[forum:/forumpost/15c4a323bb|Forum post 15c4a323bb].
drh [Sat, 16 May 2026 20:21:55 +0000 (20:21 +0000)]
When two tables are joined by USING, the affinity and collating sequence of
the join column will be the same as one or the other of the columns in the
two tables (which are hopefully the same).
drh [Sat, 16 May 2026 19:40:55 +0000 (19:40 +0000)]
When two tables are joined by USING, the affinity of the join column can
be the affinity of the corresponding column in either table. But it must
be one or the other.
drh [Sat, 16 May 2026 17:28:56 +0000 (17:28 +0000)]
Fix false-negatives in the sqlite3ExprCanReturnSubtype() routine having
to do with CASE, CAST, and COLLATE expressions and the "+" no-op operator.
[forum:/forumpost/1f0168a120:Forum post 1f0168a120].
dan [Fri, 15 May 2026 18:36:11 +0000 (18:36 +0000)]
Have window functions sum(), total() and avg() correctly handle the obscure case where integer overflow occurs as part of the same step that adds the first real value to the running total.
dan [Fri, 15 May 2026 17:24:34 +0000 (17:24 +0000)]
Have the sqlite_dbpage module correctly handle constraints of the form "WHERE pgno=$pgno" when $pgno is an integer that cannot be represented as a signed, 32-bit value.
drh [Thu, 14 May 2026 22:39:41 +0000 (22:39 +0000)]
If there is a WHERE clause constraint of the form "a=$var", then
automatically reprepare the query if the binding of $var changes, as
that could affect the query plan.
dan [Thu, 14 May 2026 17:54:23 +0000 (17:54 +0000)]
Handle constraints like "a=$var" where the value bound to $var is -1, 0 or 1 in the same way as a literal -1, 0, 1. This might cause excessive reprepares.
drh [Thu, 14 May 2026 12:46:41 +0000 (12:46 +0000)]
In QRF, relax the constraint on the screen width so that it can be as
wide as a 32-bit signed integer can count.
[forum:/forumpost/2570051b60|Forum post 2570051b60].
drh [Wed, 13 May 2026 18:07:01 +0000 (18:07 +0000)]
Change to compile-time option that omits non-UWP system calls to
SQLITE_UWP. Takes steps to eliminate all non-UWP system calls when that
compile-time option is used.
stephan [Wed, 13 May 2026 12:06:27 +0000 (12:06 +0000)]
Slightly rework the --editline configure flag for purposes of distinguishing between the two conventional libedit headers. When using libedit, invoke setlocale(), which appears to resolve [forum:aad7a634916ff050|forum post aad7a63491]'s report of non-ASCII input failng to work when linking against libedit.
drh [Mon, 11 May 2026 16:58:05 +0000 (16:58 +0000)]
Fix the xfer-optimization such that if the destination table has
constraints on the hidden rowid, the optimization is not attempted.
[forum:/forumpost/6dcc95e3ca|Forum post 6dcc95e3ca].
drh [Mon, 11 May 2026 14:22:45 +0000 (14:22 +0000)]
Prevent internal-use-only SQL functions from being used inside of a CHECK
constraint added using ALTER TABLE ADD CONSTRAINT.
[forum:/forumpost/6256ee34ed|Forum post 6256ee34ed].
drh [Mon, 11 May 2026 00:53:44 +0000 (00:53 +0000)]
Fix the xfer optimization so that it does not work if the destination is
a STRICT table that is incompatible with the source.
[forum:/forumpost/4955d2235c22ef4e|Forum post 4955d2235c22ef4e].
stephan [Sat, 9 May 2026 14:01:57 +0000 (14:01 +0000)]
In sqlite-config.tcl remove a reference to the platform name apple when checking for Mac platforms, relying on a check for darwin instead, analog to [b5c6cb13cff53f]. Intended to resolve [forum:c26b856db7dd5caf|forum post c26b856db7dd5caf].
drh [Sat, 9 May 2026 13:16:18 +0000 (13:16 +0000)]
Improved detection of OOM in the regexp_bytecode() SQLite function
(available in debug builds only).
[forum:/forumpost/a3a10e1c7b5dd1d2|Forum post a3a10e1c7b5dd1d2].
drh [Sat, 9 May 2026 12:41:23 +0000 (12:41 +0000)]
Fix an integer truncation problem due to oversized inputs to the
approximate_match virtual table extension.
[forum:/info/625f687e4d25c392|Forum post 625f687e4d25c392].
drh [Sat, 9 May 2026 12:03:14 +0000 (12:03 +0000)]
Fix a corner-case floating-point rounding problem in the generate_series()
virtual table, introduced by [c113e31b818d1677] and reported by
[forum:/info/6e6cf9054bea2b1d|forum post 6e6cf9054bea2b1d].
stephan [Tue, 5 May 2026 08:51:10 +0000 (08:51 +0000)]
For the various OPFS VFS db-import routines, in SEE builds (only) relax the is-this-a-db check to allow for SEE dbs not having the usual header string in cleartext. Addresses [https://sqlite.org/see/forumpost/f84bef3552|SEE forum post f84bef3552].
dan [Mon, 4 May 2026 18:16:09 +0000 (18:16 +0000)]
When using the OR-optimization on a loop created by exists-to-join, do the early-exit logic for the whole loop, not for each individual OR branch. Possible fix for forum post [forum:c8b205720c | c8b205720c].
dan [Mon, 4 May 2026 17:16:43 +0000 (17:16 +0000)]
When using the OR-optimization on a loop created by exists-to-join, do the early-exit logic for the whole loop, not for each individual OR branch. Possible fix for forum post [forum:c8b205720c | c8b205720c].
drh [Mon, 4 May 2026 10:14:13 +0000 (10:14 +0000)]
Honor the NO_COLOR environment variable. If NO_COLOR is set and
SQLITE_PS1 and SQLITE_PS2 are not set, then the default prompt is
monochrome and ANSI escapes are omitted. Also change the name of
the SQLITE_PS_NOANSI compile-time option to SQLITE_NO_COLOR.
drh [Sat, 2 May 2026 23:40:40 +0000 (23:40 +0000)]
Change the non-printing character escapes for editline to U+0001 and
U+0002. Also insert those escapes for readline. Readline does not
need it (because it can figure them out on its own) but they are needed
when editline is being used in readline-compatibility mode, and we have
no way of distinguishing between editline and readline in that case, so
we might as well include them.
drh [Sat, 2 May 2026 23:03:42 +0000 (23:03 +0000)]
Attempt to automatically insert U+0001 escape bytes before and after
ANSI X3.64 escape sequences when using editline, to work around the
limitations of editline.
Remove lots of code used to support legacy Windows version (WindowsXP and
before). Use Slim Reader/Writer Locks on Windows for non-recursive mutexes,
since SRWLs are now available on all supported Windows platforms.
dan [Wed, 29 Apr 2026 19:14:54 +0000 (19:14 +0000)]
Fix a crash that could occur if the destination database of a backup is
replaced using sqlite3_deserialize() between the call to sqlite3_backup_init()
and the first call to sqlite3_backup_step(). Forum post [forum:15d82885e2 | 15d82885e2].
Updates and simplifications to the mutex implementation on Windows. Uses
Slim Reader/Writer Locks for performance, for non-reentrant mutexes.
Requires WindowsVista or later.
Attempt to align instances of the sqlite3_mutex object at 128-byte boundaries
to prevent false-sharing in multi-core machines. See the discussion at and
around [forum:/forumpost/2026-03-25T23:15:03Z|forum post 2026-03-25T23:15:03Z].
stephan [Mon, 27 Apr 2026 12:05:56 +0000 (12:05 +0000)]
Increase a stack-local buffer size to resolve a test regression introduced in [ff084ae341eab5c], in which some tests fail a pattern match check if their absolute file names are too long. Resolves [forum:205f73db1b2806f5|forum post 205f73db1b2806f5].
dan [Mon, 27 Apr 2026 11:32:43 +0000 (11:32 +0000)]
Fix a crash that could occur if sqlite3_deserialize() was used to overwrite a database with an open transaction on it. Bug introduced by [fc42d31d6fca21ab] on 2018-03-07 and first released in version 3.23.0. This is not a vulnerability as an attacker that can exploit this already has the ability to execute arbitrary code. Forum post [forum:39134ba029 | 39134ba029].
In the CLI, eliminate the 2-second delay before getting the prompt back
after running a ".www" or ".excel". Instead, remember the name of the
temporary file that is to be deleted and delete it later.