stephan [Fri, 4 Jul 2025 18:38:23 +0000 (18:38 +0000)]
Propagate the -ldl and -lpthread flags, if needed, into sqlite3.pc, per request in [forum:44a58c807353162f | forum post 44a58c807353162f]. This resolves usage of that pkgconf file on some OSes.
When attempting to optimize "expr AND false" to "false" and
"expr IN ()" to "false", take care not to delete aggregate functions
in the "expr" as doing so can change the meaning of the query.
drh [Tue, 17 Jun 2025 19:32:23 +0000 (19:32 +0000)]
Avoid writing frames with no checksums into the wal file if a
savepoint is rolled back after dirty pages have already been
spilled into the wal file. Also fix a corner case in the previous
check-in on this branch.
drh [Thu, 12 Jun 2025 13:27:10 +0000 (13:27 +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 20:06:29 +0000 (20:06 +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 [Thu, 5 Jun 2025 11:57:20 +0000 (11:57 +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.
stephan [Wed, 4 Jun 2025 18:40:03 +0000 (18:40 +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:11:27 +0000 (18:11 +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.
drh [Tue, 3 Jun 2025 17:46:24 +0000 (17:46 +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 is a performance
optimization that would not normally be found on a patch branch, but
downstream needs it and does not want to wait on the next full release.
drh [Mon, 2 Jun 2025 18:42:49 +0000 (18:42 +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.
drh [Fri, 30 May 2025 11:55:07 +0000 (11:55 +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:47 +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:33:39 +0000 (20:33 +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 [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.
drh [Tue, 6 May 2025 17:53:27 +0000 (17:53 +0000)]
Fix a bug in the NOT NULL/IS NULL optimization of check-in [cb94350185f555c3]
that can cause invalid data to be used for a column if that column has a
CHECK constraint that includes the NOT NULL or IS NULL operator.
Problem discovered by the
[https://issues.chromium.org/issues/415397143|Chromium fuzzer]. Never
seen in the wild, as far as anybody knows.
drh [Sat, 3 May 2025 15:17:21 +0000 (15:17 +0000)]
Enhance sqlite3_rsync so that if the first attempt to invoke a copy
of itself on the remote system using ssh fails, try again after
augmenting the PATH. This enables sqlite3_rsync to work without the
--exe option when the remote system is a Mac.
drh [Sat, 3 May 2025 10:35:32 +0000 (10:35 +0000)]
Promote the --protocol option to sqlite3_rsync from being an undocumented
debug option to being a supported and user-visible option. This is
sometimes needed to work around bugs in prior versions running on the
remote.
drh [Sat, 3 May 2025 08:17:46 +0000 (08:17 +0000)]
Enhance sqlite3_rsync (in a backwards-compatible way) so that it has the
ability to send hashes for blocks of pages in addition to individual pages.
By judicious use of this capability, network bandwidth requirement to sync two
similar databases is reduced.
drh [Fri, 2 May 2025 17:39:21 +0000 (17:39 +0000)]
This is the start of an experiment in getting sqlite3_rsync to use less
bandwidth when the two databases are very similar, by sending hashes
over blocks of pages initially, rather than over individual pages, then
requesting more detail when hashes do not match.
drh [Fri, 2 May 2025 11:18:09 +0000 (11:18 +0000)]
Do not allow sqlite3_rsync to convert the replica from WAL-mode into
DELETE-mode, as that can disrupt existing clients on the replica side.
DELETE-mode to WAL-mode conversions are allowed, however. See
[forum:/forumpost/6b575b66156673ee|forum thread 6b575b66156].
drh [Thu, 1 May 2025 18:07:27 +0000 (18:07 +0000)]
Enhance sqlite3_rsync so that, by default, it will sync non-WAL-mode
database files. Add a new command-line option --wal-only that restricts
the sync to WAL-mode databases only (the former default). Improve
command-line option parsing so that only a single "-" is required before
each option.
Fix a harmless problem in the CLI in which SQL errors that occur during
the ".schema" command are properly ignored, yes still appear in the ".log"
output. [forum:/forumpost/42fe6520b803be51|Forum post 42fe6520b8]
Fix an issue in Bloom filters on RHS subsqueries to IN operators.
See [forum:/forumpost/792a09cb3df9e69f|forum post 792a09cb3d] for
a description of the problem. Also improve comments related
to [baa83b460c677c21] which was origin of the problem.