Disable the reuse of IN-clause subqueries if the subquery is an explicit
"SELECT ALL". The ALL keyword is almost never used in actual practice (most
developers don't even know it can be used) so this should not interfere with
the optimization, but it does give us a convenient way to turn it off for
testing purposes.
Be more aggressive about reusing subqueries that appear on the RHS of IN
operators that have been replicated due to the predicate push-down optimization.
stephan [Thu, 4 Jul 2024 09:45:23 +0000 (09:45 +0000)]
For shell completion, use pragma_table_xinfo instead of pragma_table_info, so that generated columns are handled, as reported in [forum:f0735e05d8d7e857|forum post f0735e05d8d7e857].
Reword the deliberate_fall_through macro along the lines suggested by
[forum:/forumpost/7ec11023dd|forum post 7ec11023dd] so that it works better
with LLVM, while preserving compatibility with MSVC and older GCCs.
In the CLI, if the XDG_CONFIG_HOME environment variable is not set, then also
search in ~/.config/sqlite3/sqliterc for the initialization file.
See [forum:/forumpost/5cc6d059e9e092ed|forum thread 5cc6d059e9e092ed].
drh [Sat, 29 Jun 2024 12:22:32 +0000 (12:22 +0000)]
Add a NEVER() around a branch in sqlite3ExprAffinity() that is designed to
prevent an infinite loop, but which can now never be reached due to recent
changes.
drh [Fri, 28 Jun 2024 17:14:00 +0000 (17:14 +0000)]
Do not convert an expression node that is already TK_REGISTER into a
new TK_REGISTER. This is a follow-up to [663f5dd32d9db832] that fixes a
bug discovered by dbsqlfuzz.
drh [Wed, 19 Jun 2024 16:38:17 +0000 (16:38 +0000)]
Enhance lemon.c so that when it shows the compile-time options in the header
comment of the generated output file, it shows all options, even those not
used, and it shows them in sorted order.
stephan [Tue, 18 Jun 2024 20:40:11 +0000 (20:40 +0000)]
Add fiddle-debug make target to ext/wasm. It builds the same target files as a non-debug build, as opposed to a new copy, but adds various debug-related flags.
drh [Tue, 18 Jun 2024 12:19:13 +0000 (12:19 +0000)]
Update sqlite3_analyzer to report on the number of WITHOUT ROWID tables and
to provide separate aggregate statistics for WITHOUT and WITH ROWID tables.
drh [Fri, 14 Jun 2024 23:13:54 +0000 (23:13 +0000)]
Do not omit the ORDER BY clause from a recursive CTE just because the
query that contains the CTE also contains an ORDER BY clause. Plus
other changes imported from the recursive-cte-orderby-fix branch.
stephan [Wed, 12 Jun 2024 22:15:25 +0000 (22:15 +0000)]
Remove some dead JS code. Improve the exception-to-C-result-code conversion to account for the case of a file disappearing while the OPFS VFS is waiting to acquire a lock on it.
stephan [Wed, 12 Jun 2024 12:36:02 +0000 (12:36 +0000)]
OPFS VFS: change the xCheckReservedLock() impl to always return false, as discussed in [forum:a2f573b00cda1372|forum thread a2f573b00cda1372]. This does not impact any current tests, and may have no direct impact at all because of how that VFS handles locking, but is hypothetically a more correct solution than the previous one.
drh [Tue, 11 Jun 2024 14:36:56 +0000 (14:36 +0000)]
Change constant expressions to pre-computed constants, because apparently
MSVC on ARM requires that.
[forum:/forumpost/4feb1685cced0a8e|Forum thread 4feb1685cced0a8e].
drh [Mon, 10 Jun 2024 12:43:03 +0000 (12:43 +0000)]
Improved header comment on the sqlite3FpDecode() implementation.
For the fpdecode() SQL function (available in debug builds only) limit
the value of the third parameter (mxRound) to be positive.
drh [Thu, 6 Jun 2024 01:21:57 +0000 (01:21 +0000)]
Adjust the parser so that the value of TK_ISNOT is similar to the value of
TK_IS. This helps the compiler generate faster switch() statements on the
Expr.op fields when there are cases for TK_ISNOT and other common operators.
dan [Wed, 5 Jun 2024 11:36:58 +0000 (11:36 +0000)]
Fix a very obscure issue where the name resolver could get confused if aliases like "sqlite_schema" or "sqlite_master" were used in a query involving the sqlite_temp_schema table.
drh [Mon, 3 Jun 2024 18:04:10 +0000 (18:04 +0000)]
Address a corner-case associated with the call-function-once optimization
of check-in [663f5dd32d9db832] that was causing a (harmless) use of an
uninitialized bytecode register.
dbsqlfuzz 8a44f675401a8b1f68a43bf813c4f4f72ad8f0ea
stephan [Mon, 3 Jun 2024 07:22:28 +0000 (07:22 +0000)]
Modify three #if checks in os_unix.c to improve handling of SQLITE_OMIT_WAL on WASI builds. Based on the discussion in/around [forum:57e918431735128a|forum post 57e918431735128a].
drh [Thu, 30 May 2024 13:27:29 +0000 (13:27 +0000)]
Ensure that the second pass call to wherePathSolver() always reports a positive
value for the estimated number of output rows. This fixes a long-standing
(though exceedingly minor) problem that was only revealed by a new assert()
added yesterday. dbsqlfuzz 545d6debc2da496ab2b915e33ea34d9a35a935df
drh [Wed, 29 May 2024 15:08:20 +0000 (15:08 +0000)]
Use a heuristic of artifically lowering the cost of fact tables in a
star-schema query in order to prevent plans where the fact tables are
in outer loops from being trimmed by the path limiter. This helps to
generate better (faster) query plans in those particular cases.
drh [Tue, 28 May 2024 19:08:18 +0000 (19:08 +0000)]
Fix a couple of assert() statements so that they cannot fire
when the SQLITE_TESTCTRL_INTERNAL_FUNCTIONS debugging capability
is activated. dbsqlfuzz f5b347cf167a62fbe08062b2feee65cb9306e363.
drh [Tue, 28 May 2024 12:41:11 +0000 (12:41 +0000)]
Increase the number of parallel paths in the query solver from 12 to 20.
In the .wheretrace output, sort the parallel paths in order of increasing
cost.
drh [Tue, 28 May 2024 00:16:52 +0000 (00:16 +0000)]
Improve the automatic-index decision such that no attempt is made to create
an automatic index on a column that is known to be non-selective because if
its use in other indexes that have been analyzed. See
[src:/tktview/8ff324e120|ticket 8ff324e120] and
[forum:/forumpost/b21c2101a559be0a|forum post b21c2101a559be0a].
drh [Mon, 27 May 2024 15:13:49 +0000 (15:13 +0000)]
Very small performance increase and size reduction by removing unnecessary
ALWAYS() macros from the btree balance logic and replacing them with
special initialization of CellArray and some assert()s.
drh [Mon, 27 May 2024 13:24:39 +0000 (13:24 +0000)]
For compatibility with PostgreSQL, when right-hand side of the ->> operator
is negative, it should index from the right side of the JSON array on the
left-hand side.