stephan [Tue, 17 Jun 2025 14:37:31 +0000 (14:37 +0000)]
proj.tcl portability fixes and cleanups suggested in [forum:7b218c3c9f|forum post 7b218c3c9f]. Branching so that it can be tested on msys/cygwin/haiku before committing to it.
drh [Mon, 16 Jun 2025 17:36:11 +0000 (17:36 +0000)]
Fix an issue going back to version 3.39.0 with transitive IS constraints
in queries that make use of RIGHT JOIN. Problem reported by
[forum:/forumpost/68f29a2005|forum post 68f29a2005].
drh [Mon, 16 Jun 2025 15:34:26 +0000 (15:34 +0000)]
Make the show-%p-az-zero hack of the previous check-in configurable at
run-time using the 0x100000 bit of either .treetrace or .wheretrace.
As before, this is all a no-op except for debugging builds.
dan [Thu, 12 Jun 2025 07:35:38 +0000 (07:35 +0000)]
Have sqlite3_setlk_timeout() take the database handle mutex. This fixes an assert() failure that could occur if sqlite3_setlk_timeout() were called on a threadsafe handle.
drh [Tue, 10 Jun 2025 19:52:21 +0000 (19:52 +0000)]
Improved selection of the divisor when subdividing nested Bitvec objects.
This fixes a potential stack overflow that can occur when the database size
is within 60 pages of the maximum allowed by the file format.
drh [Tue, 10 Jun 2025 16:02:29 +0000 (16:02 +0000)]
Improved diagnostics for Bitvec: Add the sqlite3ShowBitvec() routine that
can be called from a debugger (only available with SQLITE_DEBUG). Add new
output opcodes for sqlite3BitvecBuiltinTest().
drh [Fri, 6 Jun 2025 23:02:03 +0000 (23:02 +0000)]
Update the "msort" function in Lemon so that it works with lists of any
length, and also so that the sort is stable. This patch was motivated by
[forum:/forumpost/63750d717c9ed961|forum post 63750d717c] but was
independently developed, then tested by temporarily setting LISTSIZE to 2.
drh [Thu, 5 Jun 2025 18:28:54 +0000 (18:28 +0000)]
Enhance the FSDIR virtual table with a new "level" column. The query planner
knows how to optimize to avoid search deeper than the maximum requested level.
stephan [Wed, 4 Jun 2025 18:34:20 +0000 (18:34 +0000)]
tea build: add an info-exists check after a 'scan' call, as scan does not create its target vars on error. Problem reported at [forum:fde857fb8101a4be | forum post fde857fb8101a4be] and triggers when the 'vsatisfies' test for the host's Tcl version fails (so the build would fail anyway, but will fail more informatively with this fix).
stephan [Tue, 3 Jun 2025 18:10:59 +0000 (18:10 +0000)]
Apply the duplicate 'export default' workaround to the (untested and unsupported) node-specific build rules in mkwasmbuilds.c to resolve a problem reported off-list by Thomas Steiner.
dan [Mon, 2 Jun 2025 18:48:36 +0000 (18:48 +0000)]
Fixes to ensure SQLITE_ENABLE_SETLK_TIMEOUT builds use a blocking lock and do not call xSleep() when (a) opening a snapshot transaction, and (b) when blocked by another process running recovery.
drh [Mon, 2 Jun 2025 18:34:17 +0000 (18:34 +0000)]
Improve the accuracy of affinity and collating sequence analysis for
NATURAL JOINs to the left of RIGHT JOINs where source tables are views
or subqueries. Initial problem report in
[forum:/forumpost/829306db47|forum post 829306db47].
stephan [Mon, 2 Jun 2025 15:10:41 +0000 (15:10 +0000)]
TEA: remove the stale man page and references to the MSC makefiles from the README.txt. Based on discussion at [forum:87e6660191a472c5 | forum post 87e6660191a472c5]. A couple of weeks ago we internally discussed pulling in the MSC makefiles from the 3.49 tree but they are stale and possibly unused, so opted against it for the time being.
drh [Sun, 1 Jun 2025 21:38:35 +0000 (21:38 +0000)]
Fix an off-by-one error in the size computation of a vdbe-sorter.
[forum:/forumpost/c1cc8b057a|Forum post c1cc8b057a].
Problem introduced by checkin [d4307a0d43f42e96].
drh [Sat, 31 May 2025 18:26:37 +0000 (18:26 +0000)]
New makefile target "xdevtest" works like "releasetest" except that it
omits the "verify-source" dependency so that it can be run with uncommitted
changes in the source tree.
drh [Sat, 31 May 2025 16:17:14 +0000 (16:17 +0000)]
Relax query flattener constraint (3b) and thereby allow flattening the RHS of
a LEFT JOIN even if the RHS contains a virtual table. This was previously
disallowed by [9dbae1df75219e2a] as a performance optimization. It
turns out that the constraint causes performance issues, and we do not have
a record of any performance issue that it solves.
drh [Fri, 30 May 2025 19:55:46 +0000 (19:55 +0000)]
When synthesizing an ON constraint from a USING or NATURAL, if the left-hand
side is coming from a RIGHT JOIN, be sure to set the EP_CanBeNull flag so that
the optimizer knows to check for NULL even if the column has a NOT NULL
constraint. Fix for the problem reported by
[forum:/forumpost/4fc70203b61c7e12|forum post 4fc70203b61]
stephan [Fri, 30 May 2025 16:08:31 +0000 (16:08 +0000)]
Configure-related fixes and additions, most notably integration of self-tests for proj.tcl's APIs. Teaish make-install fixes based on the discussion in [forum:87e6660191a472c5 | forum thread 87e6660191a472c5].
dan [Fri, 30 May 2025 11:14:11 +0000 (11:14 +0000)]
Add "include <stddef.h>" to fts5 and rtree to ensure that they use the system version of the offsetof() macro when it is available, as the built-in version triggers ubsan errors with clang.
stephan [Fri, 30 May 2025 10:18:09 +0000 (10:18 +0000)]
Squelch an interesting but harmless struct initialization warning emitted after an emsdk update. Fix JS breakage introduced by changes in Emscripten 4.0.7: manually export the HEAPxyz symbols which used to be exposed by default.
stephan [Thu, 29 May 2025 20:29:13 +0000 (20:29 +0000)]
Fix the missing -lm link flag for the sqlite3 shell when building the autoconf bundle with --disable-static-shell, as reported in [forum:5adf1c932a | forum post 5adf1c932a].
drh [Thu, 29 May 2025 18:44:41 +0000 (18:44 +0000)]
Extend the fix for ticket [623eff57e76d45f6] so that it covers RIGHT JOIN
in addition to LEFT JOIN. Problem reported by
[forum:/forumpost/7dee41d32506c4ae|forum post 2025-05-29T15:10:14Z].
drh [Wed, 28 May 2025 16:56:23 +0000 (16:56 +0000)]
Do not use a partial index unless the WHERE clause uses one or more columns
from the table being indexed. This resolves the issue reported by
[forum:/forumpost/a8704b30f3|forum post 2025-05-28T13:03:40Z]. Test cases
are in TH3.
stephan [Mon, 26 May 2025 15:20:57 +0000 (15:20 +0000)]
When detecting TCLLIBDIR, skip over //zipfs paths, as the (file isdirectory) command will actually return true for those, but they're useless for installation purposes. This resolves the tea build's inability to install on stock openbsd.
stephan [Sat, 17 May 2025 11:06:02 +0000 (11:06 +0000)]
Latest teaish pieces, most significantly for tcl portability fixes. Move autoconf/teaish/autosetup/... to autosetup/teaish/. to simplify maintenance and deployment via the autoconf bundle.
drh [Fri, 16 May 2025 17:30:20 +0000 (17:30 +0000)]
Fix the optimization of check-in [663f5dd32d9db832] that strives to avoid
duplicate compuations in the GROUP BY clause so that it works even if the
GROUP BY term is a subquery on the RHS of a LEFT JOIN. Problem found
by dbsqlfuzz. Test cases in TH3.
drh [Thu, 15 May 2025 11:20:54 +0000 (11:20 +0000)]
Rework the showHelp() function in the CLI implementation so that its
purpose and operation are well described by the header commit. Omit
the use of enums that cause issues for MSVC 2025.
drh [Wed, 14 May 2025 16:40:05 +0000 (16:40 +0000)]
Back out the "low-quality index" query planner hack of check-in
[bcac937526d9a6ef]. Subsequent query planner enhancements for dealing
with star-queries make that change unnecessary and the change was recently
found to cause a performance regression in an unrelated query.
Also fix a typo in a debugging message.
drh [Sat, 10 May 2025 17:09:53 +0000 (17:09 +0000)]
Provide the SQLITE_BUG_COMPATIBLE_20250510 compile-time option that restores
the JSON5 bug fixed in the previous check-in, in case some applications need
it for legacy compatibility.
drh [Sat, 10 May 2025 15:53:17 +0000 (15:53 +0000)]
Add enforcement of the obscure JSON5 syntax rule that the \0 escape
sequence must not be followed by a digit.
[forum:/forumpost/c061e87faf7d1c55|Forum post c061e87faf].
drh [Thu, 8 May 2025 16:18:18 +0000 (16:18 +0000)]
Fix PRAGMA trusted_schema=OFF and similar so that it restricts the kinds
of functions in CHECK constraints that the documentation says it does. It
was letting through some function that it ought not have. This is a
defect in [5720924cb07766cd]. See
[forum:/forumpost/3fa9d44c0b381342|forum thread 2025-05-08T08:50Z].
Additional test cases will be added separately.