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.
stephan [Tue, 11 Mar 2025 11:24:52 +0000 (11:24 +0000)]
Teach testrunner.tcl to distinguish Cygwin from Windows. This gets it running but then all downstream tests fail, at least in part because of the build target name discrepancies between the platform which requires .exe and those which do not.
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.
stephan [Mon, 10 Mar 2025 15:27:17 +0000 (15:27 +0000)]
Ensure that the 'clean' target for Makefile.msc cleans up the testdir dir, analog to how the canonical makefile works, as stale files there have been leading to test failures.
stephan [Mon, 10 Mar 2025 15:15:13 +0000 (15:15 +0000)]
Reimplement pathname conversion on Cygwin. MSC test passes/failures are on par with trunk and 'make test' running on cygwin is down to a single failure.
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 [Sat, 8 Mar 2025 06:53:06 +0000 (06:53 +0000)]
Test app/script patches from Jan Nijtmans for cygwin. Add/replace many more sentinel arguments for TCL variadic functions which specifically need a NULL trailing argument. With this, 'make test' on cygwin runs to completion for me, with 134 of 329227 tests failing. MSC build fails the same 13 tests which fail for me in trunk.
stephan [Fri, 7 Mar 2025 06:54:04 +0000 (06:54 +0000)]
os_win.c patches for Cygwin (described in the cygwin-fixes branch wiki page). Makefile.msc's test target on trunk fails the same 13 tests as this branch.
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.
stephan [Tue, 25 Feb 2025 20:55:14 +0000 (20:55 +0000)]
Approximately 50 typo fixes, spanning the whole tree, contributed via [forum:006c8fa165083ac3|forum post 006c8fa165083ac3] and individually checked for correctness. Affects only code comments, docs, and a single line of debug output in a test app.
drh [Tue, 25 Feb 2025 20:10:46 +0000 (20:10 +0000)]
Change the default control-character escape algorithm from "symbol" to
"ascii", since the "ascii" algorithm works even on terminals that do
not support unicode.