drh [Wed, 24 Dec 2025 14:03:15 +0000 (14:03 +0000)]
Enhance the omit-noop-join optimization so that it is able to omit a
chain of noop-joins. Optimization improvement suggested by
[forum:/forumpost/11a53f2bad|forum post 11a53f2bad].
dan [Mon, 22 Dec 2025 15:22:02 +0000 (15:22 +0000)]
Add the SQLITE_PREPARE_FROM_DDL flag to sqlite3_prepare_v3(). Use this to prevent fts3/4 tables in non-trusted schemas from calling unsafe SQL functions.
dan [Thu, 18 Dec 2025 18:47:49 +0000 (18:47 +0000)]
Allow queries that use "GROUP BY e1 ORDER BY e2" where e1 and e2 are identical aprt from ASC/DESC sort-orders to be optimized using a single index. Also allow virtual tables to optimize DISTINCT in cases where the result-set of a query does not exactly match the ORDER BY clause.
drh [Thu, 18 Dec 2025 14:01:43 +0000 (14:01 +0000)]
Enhance the sqlite3_load_extension() so that when the entry point is
not specified, after trying sqlite3_extension_init() and
sqlite3_X_init() where X is the alphabetic part of the base filename,
if neither or found it tries again with X as the alpha*numeric* part
of the base filename. Hence, a shared library named "vt02.so" can be
loaded with just ".load vt02" and without having to specify the entry
point separately.
drh [Tue, 16 Dec 2025 13:25:45 +0000 (13:25 +0000)]
CLI improvements. In the .check command, ignore leading and trailing
whitespace unless the --exact option is used. In the .limit command, do
not print the new limit when changing the limit, but only when requesting
the current value of the limit.
dan [Mon, 15 Dec 2025 18:45:22 +0000 (18:45 +0000)]
Fix for optimizing "SELECT DISTINCT ...cols... FROM vtab" in cases where the virtual table implementation is able to deliver results sorted by "...cols...".
drh [Mon, 15 Dec 2025 17:32:56 +0000 (17:32 +0000)]
Enhance the vtablog extension so that it shows the value of
sqlite3_vtab_distinct() in xBestIndex, and so that provides the new
consume_order_by option that can cause xBestIndex to set the
orderByConsumed flag.
drh [Sat, 13 Dec 2025 21:11:49 +0000 (21:11 +0000)]
In the CLI, if a command-line argument names a file and the filename ends
with .sql or .txt, then process that file as an SQL script. Use this
feature for better testing.
drh [Fri, 12 Dec 2025 12:06:42 +0000 (12:06 +0000)]
Add new assert() statements designed to detect and prevent the kind
of system interface numbering errors that happened in [108691a3cb2f296f]
and that were not fixed until [fe49703034bd23fa].
drh [Wed, 10 Dec 2025 16:10:26 +0000 (16:10 +0000)]
Add the --titlelimit option to CLI, defaulting to 20. In "line" mode of
the CLI, the default seperator is changed from " = " to ": ". This can be
overridden using the --colsep option.
dan [Tue, 9 Dec 2025 13:41:01 +0000 (13:41 +0000)]
In fts5, avoid holding an open blob handle after an INSERT/UPDATE/DELETE statement, as this can interfere with sqlite3_interrupt(). Forum post [forum:/forumpost/95413eb410 | 95413eb410].
stephan [Mon, 8 Dec 2025 13:06:27 +0000 (13:06 +0000)]
Introducing kvvfs v2 for the JS bindings. Summary: no longer hard-coded to session/localStorage, available outside of the main UI thread (non-persistently), a simpler-to-use import/export API, and adds an asynchronous event interface intended for creating page-by-page db backups.
drh [Sat, 6 Dec 2025 20:41:24 +0000 (20:41 +0000)]
In the zipfile extension, only return as many bytes as Inflate actually
generated. [forum:/forumpost/761eac3c82|Forum post 761eac3c82].
Adjust ./configure so that it builds zipfile into testfixture if ZLIB
is available, so that tests get run on unix platforms.
drh [Sat, 6 Dec 2025 11:54:43 +0000 (11:54 +0000)]
Fox the "box" format, use rounded corners and use a double-line to separate
the header from the content. Add the "-quote relaxed" text rendering mode
and make it the default for TTYs.
drh [Fri, 5 Dec 2025 19:45:43 +0000 (19:45 +0000)]
In the Windows Makefile.msc, never set -DNDEBUG. And add the "env" target
which prints out the value of all 127 configuration variables that
Makefile.msc uses.
drh [Fri, 5 Dec 2025 12:22:23 +0000 (12:22 +0000)]
Enhance the unixIsSharingShmNode() code (check-in [6385a1962c69c69c])
so that it more understandable by humans, and so that it does not trigger
false positive deadlock warnings in TSAN.
drh [Fri, 5 Dec 2025 01:33:23 +0000 (01:33 +0000)]
Another fix to [e33da6d5dc964db8]: Ensure that the EXISTS-to-JOIN break
happens even if the inner loop is a "no-op" loop that never executes more
than once because it is controlled by a UNIQUE index. This resolves the
error reported in [forum:/forumpost/7992838ba2|forum post 7992838ba2].
Test cases are in TH3.
dan [Thu, 4 Dec 2025 16:44:11 +0000 (16:44 +0000)]
Limit compile time value SQLITE_MAX_SQL_LENGTH to 1024 less than 2^31, or 2147482624. This is to avoid having to deal with edge cases related to 32-bit integer overflow that can only occur in custom builds.
drh [Thu, 4 Dec 2025 00:05:49 +0000 (00:05 +0000)]
Fix an incorrect answer that might arise if a scalar query is both
DISTINCT and contains an OFFSET clause.
[forum:/forumpost/2025-12-03T09:25:59Z|Forum post 2025-12-03T09:25:59Z].
drh [Wed, 3 Dec 2025 21:31:53 +0000 (21:31 +0000)]
More aggressive optimization of IS NULL and IS NOT NULL operators in
the parser. New sqlite3ExprInt32() internal interface for creating
integer nodes in an expression tree.
dan [Wed, 3 Dec 2025 14:39:25 +0000 (14:39 +0000)]
Fix a problem that could occur when a scalar subquery had both a DISTINCT and OFFSET clause. First reported by [forum:41bd7af485 | forum post 41bd7af485].
stephan [Tue, 2 Dec 2025 18:28:22 +0000 (18:28 +0000)]
kvvfs: make the filename suffixes -wal and -shm illegal and teach xAccess() to silently not fail for illegal names (else it breaks things when a -wal file is checked for).
dan [Tue, 2 Dec 2025 14:43:59 +0000 (14:43 +0000)]
Fix a problem with ALTER TABLE DROP COLUMN commands where the column being dropped is the rightmost in table and is immediately preceded by a comment containing a "," character.
stephan [Mon, 1 Dec 2025 22:20:54 +0000 (22:20 +0000)]
Begrudingly allow sqlite3_js_kvvfs_clear() to work for opened storage only for the local/session storage cases and only (one of the demo apps reminds me) for backwards compatiblity. Likewise, the JsStorageDb.clearStorage() inherited method is now deprecated because it requires an opened db (but continues to work for those two stores), whereas its 'static' method of the same name is unaffected. Rename kvvfs.size() to kvvfs.estimateSize().