drh [Wed, 21 Aug 2024 18:57:55 +0000 (18:57 +0000)]
Add the new SQLITE_TESTCTRL_OPTGET that retrieves the current optimization
setting. Use this in the CLI to provide symbolic fine-grain control
over optimization settings using the ".testctrl opt" dot-command.
drh [Wed, 21 Aug 2024 12:01:46 +0000 (12:01 +0000)]
Add code comments for a "table-of-contents" and various milestone marks in
the 1300+ line long sqlite3Select() function, to help improve readiability
and maintainability. Comment changes only - no functional changes.
drh [Tue, 20 Aug 2024 23:11:28 +0000 (23:11 +0000)]
Refactor the SrcItem object to move fields associated with subqueries out
into a separate object named Subquery. This reduces the size of the SrcItem
object by about 1/3rd and provides improved performance.
drh [Tue, 20 Aug 2024 14:12:16 +0000 (14:12 +0000)]
When the database encoding is UTF-16LE and the GLOB optimization is used,
it is ok to use the range search over an index, but it is not ok to
disable the actual GLOB function call.
drh [Tue, 20 Aug 2024 12:09:55 +0000 (12:09 +0000)]
Fix for the UTF-16LE problem reporte by
[forum:/forumpost/dc7e1b7527e84343|forum post dc7e1b7527e84343]. Because of
the unexpected ordering of characters using the default collation (memcmp()
order) in UTF-16LE, the LIKE/GLOB optimization restricts its attention to
the pattern prefix that is all ASCII, which is the common case.
drh [Mon, 19 Aug 2024 22:48:30 +0000 (22:48 +0000)]
Refactor the SrcItem object so that information about subqueries is stored
in a separately allocated Subquery object. This reduces the memory requirements
for SrcItem and makes the code run faster. It also provides an expansion path
for subquery processing that does not burden simple queries. The current
checking mostly works, but there are still issues that need to be tracked
down and fixed.
drh [Sat, 17 Aug 2024 16:17:16 +0000 (16:17 +0000)]
Adjust Makefile.in so that it outputs a slightly better error message on an
attempt to build something that requires TCL libraries when HAVE_TCL is false.
drh [Sat, 17 Aug 2024 15:52:21 +0000 (15:52 +0000)]
Adjust the "configure" script so that it just disables the ability to
run tests rather than erroring out if tclsh is unable to recommend a
suitable tclConfig.sh.
drh [Fri, 16 Aug 2024 18:51:46 +0000 (18:51 +0000)]
If a subquery has an ORDER BY clause and that ordering is helpfile in
satisfying the ORDER BY or GROUP BY of the outer query without doing an
extra sort, then omit or reduce the sort in the outer query. Call
this the "order-by-subquery optimization".
drh [Thu, 15 Aug 2024 23:38:52 +0000 (23:38 +0000)]
If a subquery is materialized due to an ORDER BY and that ordering is useful
in helping to satisfy the ORDER BY or GROUP BY in the order query without
doing an extra sort, then omit the extra sort.
drh [Sat, 10 Aug 2024 10:05:22 +0000 (10:05 +0000)]
Enhancements to covering-index prediction. In particular, avoid the
false-positive prediction described by
[forum:/forumpost/e60e4c295d22f8ce|forum post e60e4c295d22f8ce].
Add early detection of over-prediction of covering-indexes so that
sqlite3_prepare() will return an error rather than just generate bad
bytecode.
dan [Fri, 9 Aug 2024 20:59:50 +0000 (20:59 +0000)]
Ensure tokenizers registered with xCreateTokenizer_v2() can be accessed using xFindTokenizer(), and that those registered with xCreateTokenizer() work with xFindTokenizer_v2().
drh [Fri, 9 Aug 2024 18:18:11 +0000 (18:18 +0000)]
Fix the internal routine sqlite3ResolveExprListNames() so that it returns
SQLITE_OK or SQLITE_ERROR instead of WRC_Continue or WRC_Abort. Without this
fix, some times of obscure syntax errors end up returning SQLITE_INTERNAL
rather than SQLITE_ERROR.
drh [Fri, 9 Aug 2024 17:09:18 +0000 (17:09 +0000)]
Do not attempt to use a covering index based purely on columns-used
when doing an UPDATE or DELETE of a WITHOUT ROWID table. Raise an
SQLITE_INTERNAL error if there is ever a situation where a table reference
cannot be converted into an index reference when the query planner thinks
that a covering index is appropriate.
stephan [Fri, 9 Aug 2024 12:19:11 +0000 (12:19 +0000)]
Remove unused static var cBadGroup from ext/consio/console_io.c to resolve a compiler warning reported in the fossil forum. This is a build fix, not a functional change.
drh [Thu, 8 Aug 2024 14:45:50 +0000 (14:45 +0000)]
Do not let the number of terms on a VALUES clause be limited by
SQLITE_LIMIT_COMPOUND_SELECT, even if the VALUES clause contains elements
that appear to be variables due to the use of double-quoted string literals.
[https://issues.chromium.org/issues/358174302|Chromium issue 358174302].
drh [Thu, 8 Aug 2024 12:14:07 +0000 (12:14 +0000)]
Back out the --memory option to ".parameter init" in the CLI, as the
capability is no longer needed for testing due to the new "$int_N" and
"$text_T" automatic bindings, and the "init --memory" is hence just
added complication.
drh [Thu, 8 Aug 2024 12:08:36 +0000 (12:08 +0000)]
In the CLI, recognize magic parameter names "$int_NNN" and "$text_TTT" and
bind them with integer value NNN and text value TTT respectively. Intended
for testing and debugging use only.
drh [Thu, 8 Aug 2024 10:10:38 +0000 (10:10 +0000)]
Add the --memory option to the ".parameter init" CLI command. When present,
the --memory option causes the sqlite_parameters table to be created in a
completely independent :memory: database. This can be done to avoid
parameter binding queries from being affected by debug settings such as
".wheretrace", ".treetrace", "PRAGMA vdbe_addoptrace=on", and similar.
drh [Tue, 6 Aug 2024 10:29:41 +0000 (10:29 +0000)]
Change the AggInfoColumnReg() and AggInfoFuncReg() macros for
compilers that cannot parse empty elements of a comma expression.
[forum:/forumpost/8fd21998dc|Forum post 8fd21998dc].
drh [Sat, 3 Aug 2024 23:00:17 +0000 (23:00 +0000)]
Fix to the previous checkin: The colUsed parameter should have high-order bit
set if any of the 64-th or greater columns of the virtual table is used. The
lower 63 bits of colUsed always show the usage of the first 63 columns of the
virtual table.