drh [Sat, 22 Mar 2025 22:55:33 +0000 (22:55 +0000)]
Fix the generate_series() enhancement from check-in [d50b784807333c54]
so that it works even if the number that "value" is being compared against
is a non-integer floating point number. Bug reported by
[forum:/forumpost/0d5d63257e3ff4f6|forum post 0d5d63257].
stephan [Sat, 22 Mar 2025 19:07:54 +0000 (19:07 +0000)]
Replace use of autosetup/lib/*.auto for sqlite-custom-... features to avoid the possibility of multiple files being loaded (in an unpredictable order) for that purpose. Instead look for autosetup/sqlite-custom.tcl and source it if it exists. The intent is that sqlite-custom.tcl only ever be added in vendor-specific branches and never in the trunk.
stephan [Sat, 22 Mar 2025 18:41:48 +0000 (18:41 +0000)]
In the post-configure validation, ensure than no more than one autosetup/lib/*.auto file is found, for reasons explained in the validation's error message.
stephan [Sat, 22 Mar 2025 17:28:29 +0000 (17:28 +0000)]
Document the new configuration customization approach and extend it to enable sqlite-custom-flags to return an empty string to denote that it does not require any new flags (it may still customize flag default values in such cases).
stephan [Sat, 22 Mar 2025 17:00:32 +0000 (17:00 +0000)]
Teach mkautoconfamal.sh to avoid copying autosetup/local.tcl and autosetup/*.auto except for autosetup/lib/CURRENT-BRANCH-NAME.auto (if any), the intent being to use lib/CURRENT-BRANCH-NAME.auto for branch-specific configuration customizations.
stephan [Sat, 22 Mar 2025 16:14:34 +0000 (16:14 +0000)]
Add a mechanism to the configure script to allow certain client-specific builds to extend or override the configure options without having to edit sqlite-config.tcl, the goal being to reduce merge conflicts in those builds when updating sqlite-config.tcl from the canonical copy.
stephan [Sat, 22 Mar 2025 12:15:13 +0000 (12:15 +0000)]
In the autoconf bundle, do not strip binaries during installation, for parity with the canonical build and the legacy build. Discussed in [forum:9a67df63eda9925c|forum post 9a67df63eda9925c]. A potential TODO here is to add a configure flag which either enables or disables stripping.
stephan [Fri, 21 Mar 2025 16:06:16 +0000 (16:06 +0000)]
Proxy configure's msg-debug with proc-debug, which works the same except that it prepends the name of the calling proc to the debug message. No functional changes.
drh [Thu, 20 Mar 2025 11:47:39 +0000 (11:47 +0000)]
Fix a problem in the sqlite_dbpage() table-valued function when it is
trying to truncate a file in locking-mode=EXCLUSIVE and the file was
obtained via sqlite3_deserialize(). Problem found by dbsqlfuzz.
drh [Tue, 18 Mar 2025 20:15:16 +0000 (20:15 +0000)]
Change the generate_series() table-valued function so that its rowid is just an
alias for its value. This allows it to be used as the RHS operand of a
RIGHT JOIN. This fixes the issue raised by
[forum:/forumpost/1e17219c88|forum post 1e17219c88].
dan [Tue, 18 Mar 2025 19:21:04 +0000 (19:21 +0000)]
Fix a problem that could occur when the RHS of an IN operator was a compound SELECT featuring an ORDER BY on a subquery that was flattened into one of the component SELECTs introduced by [baa83b460c677c21]. Forum post [/forumpost/1e17219c88].
stephan [Tue, 18 Mar 2025 10:28:56 +0000 (10:28 +0000)]
Update the docs in tool/mkccode.tcl to reflect that it's more generic than it was when the docs were written. Change the shebang line to use /bin/env tclsh instead of a hard-coded tclsh path.
stephan [Sun, 16 Mar 2025 14:05:42 +0000 (14:05 +0000)]
Fix a long-standing filename digest computation bug in the OPFS SAHPool VFS which caused all VFS-stored filenames to have a digest value of 0. See [/forumpost/042d53c928382021] and for full details.
stephan [Sun, 16 Mar 2025 13:09:21 +0000 (13:09 +0000)]
Add --asan-fsanitize=... configure flag to the canonical build to optionally set -fsantize flags for the fuzzcheck-asan tool. Teach proj-check-fsanitiz to fail for flags which the compiler emits any warning for, for reasons described in its comments.
drh [Sun, 16 Mar 2025 00:13:29 +0000 (00:13 +0000)]
Rework the run-fuzzcheck makefile target so that it better exploit parallelism.
Test case "<tt>make -j16 run-fuzzcheck FUZZDB=20250222.db</tt>"
went from 596 seconds down to 107 seconds.
drh [Sat, 15 Mar 2025 19:55:19 +0000 (19:55 +0000)]
Make use of the C99 flexible array feature, when available, so that
the -fsanitize=bounds-strict option can be used, when available.
[forum:/forumpost/311dbf9a1cadfae6|Forum thread 311dbf9a1c].
drh [Sat, 15 Mar 2025 13:04:16 +0000 (13:04 +0000)]
Use flexible arrays in the recovery extension and in the fuzzcheck test program.
Adjust the unix makefile to use -fsanitize=bounds-strict when building
fuzzcheck-asan.
drh [Fri, 14 Mar 2025 18:10:02 +0000 (18:10 +0000)]
Make use of the flexible-array feature of C99, when available, to try to
pacify -fsanitize=strict-bounds. This check-in fixes the core. There is
more yet to do in FTS3, RTREE, and in FTS5.
drh [Thu, 13 Mar 2025 18:51:18 +0000 (18:51 +0000)]
Fix the generate_series extension for the case where the termination value
is not an even multiple of the step from the start value and there is also
a value=NNN constraint in the WHERE clause.
[forum:/info/bf2dc8e909983511|Forum post bf2dc8e9]
drh [Tue, 11 Mar 2025 12:19:27 +0000 (12:19 +0000)]
The substitute "puts" command used by the Windows implementation of
sqlite3_analyzer must invoke fflush() after each line of output. Otherwise
the output can be truncated when redirected into a file.
drh [Mon, 10 Mar 2025 22:31:55 +0000 (22:31 +0000)]
Ensure that the TEMP database has been initialized at the beginning of
a call to sqlite3_open_blob() for the TEMP database. Fix for the issue
reported by [forum:/forumpost/0a556d619b|forum post 0a556d619b].
stephan [Mon, 10 Mar 2025 17:28:43 +0000 (17:28 +0000)]
Add an explicit db close to test/walsetlk.test to work around an unjustified test failure on Windows when the walsetlk tests are run in the same invocation of testfixture.exe in Windows.
drh [Mon, 10 Mar 2025 10:32:31 +0000 (10:32 +0000)]
Disable the [d1ba200234f40b84|count-of-view optimization] if any subquery
is DISTINCT, as the optimization does not work in that case.
Bug reported by [forum/forumpost/a860f5fb2e|forum post a860f5fb2e].
stephan [Thu, 6 Mar 2025 09:29:15 +0000 (09:29 +0000)]
Back out the most significant part of [5c28a17253e2f], as Cygwin is a hybrid. With SQLITE_OS_UNIX it will use POSIX locking, which will misinteract with apps using Windows-style locking.
stephan [Tue, 4 Mar 2025 21:31:18 +0000 (21:31 +0000)]
Roll back part of [6d87a8efe]: the check for tclsh90.exe (as opposed to tclsh9.0.exe) is incorrect on these platforms (it's an msvc build). Also remove an unused function added in that checkin.
stephan [Tue, 4 Mar 2025 05:16:10 +0000 (05:16 +0000)]
Document the EXTRA_SRC makefile var and add --amalgamation-extra-src=list to the canonical-build configure script as the formal way to pass that at configure-time.
stephan [Mon, 3 Mar 2025 14:15:13 +0000 (14:15 +0000)]
Internal configure script cleanups. Resolve an as-yet-hypothetical corner case involving the --dev flag mixed with custom CFLAGS containing SQLITE_ENABLE... or SQLITE_OMIT... flags. Fix an unrelated API doc typo reported in [forum:606ea661df|forum post 606ea661df].
stephan [Mon, 3 Mar 2025 11:48:09 +0000 (11:48 +0000)]
Minor configure script doc tweaks. This is also a note that the basic elements of the build run as-is on Haiku OS Beta 5 but the tcl bits do not (for lack of tclConfig.sh).
stephan [Sat, 1 Mar 2025 23:44:11 +0000 (23:44 +0000)]
Use SQLITE_EXTRA_INIT_MUTEXED instead of SQLITE_EXTRA_INIT for the SQLITE_WASM_EXTRA_INIT feature, as suggested in [forum:14183b98fc0b1dea|forum post 14183b98fc0b1dea]. This doesn't make a functional difference now - this is in the name of future-proofing against eventual threading support in wasm.
stephan [Thu, 27 Feb 2025 21:17:55 +0000 (21:17 +0000)]
Approximately 100 typo corrections spanning the whole tree, submitted via [forum:0db9827f0464bc33|forum post 0db9827f0464bc33] and individually audited and verified. Affects only code comments, innocuous test strings, error message text in tool (not library) code, and configure-level help text.
stephan [Thu, 27 Feb 2025 19:40:02 +0000 (19:40 +0000)]
Reimplement testrunner_data.tcl::trd_get_bin_name() to assume a .exe extension on all platforms not matching "unix", to avoid having to do file-exists checks.
drh [Thu, 27 Feb 2025 16:07:49 +0000 (16:07 +0000)]
Strive to make sorts stable in the mkpragmatab.tcl build script, so that
we get consistent amalgamations regardless of platform.
[forum:/forumpost/c9914addebf3da51|Forum thread c9914addebf3da51].
dan [Thu, 27 Feb 2025 11:03:54 +0000 (11:03 +0000)]
Add support for SQLITE_EXTRA_INIT_MUTEXED - like SQLITE_EXTRA_INIT, but is called from within sqlite3_initialize() when the SQLITE_MUTEX_STATIC_MAIN mutex is still held.
stephan [Wed, 26 Feb 2025 19:22:52 +0000 (19:22 +0000)]
Teach testrunner how to run local binaries which have a .exe extension. Also teach it to recognized mingw environments (but actually building the test programs there currently doesn't work).
stephan [Wed, 26 Feb 2025 17:11:25 +0000 (17:11 +0000)]
Undo part of [69e83ab859c], as that order of operations breaks the --prefix=... configure flag. Found a workaround for the library version and OS/environment info being emitted when --help.
stephan [Wed, 26 Feb 2025 16:15:34 +0000 (16:15 +0000)]
configure: extend the readline detection a bit so that it can find readline on termux environments without having to be told where it is. Fix a typo in a libedit-related message.
stephan [Wed, 26 Feb 2025 03:03:08 +0000 (03:03 +0000)]
More work on the sahpool digest fix. New/fixed versions can read legacy (no digest) files but the reverse is only possible in limited circumstances (when files originated from a legacy version). The burning question is whether the real fix would be to remove this digest check altogether, as it only applies in a very limited context, and the fact that it was broken for some 18 months unnoticed suggests that its value might not be worth the CPU cycles.