drh [Tue, 26 Nov 2024 23:40:54 +0000 (23:40 +0000)]
Allow the iif() function to work with two arguments. The third argument is
then assumed to be NULL. Also allow if() as an alternative spelling for iif().
stephan [Tue, 26 Nov 2024 19:19:12 +0000 (19:19 +0000)]
Patch autosetup to rename --debug to --autosetup-debug so we can use --debug/--enable-debug for its historical purpose. Update autosetup/README.md with details of the patch.
stephan [Tue, 26 Nov 2024 19:02:16 +0000 (19:02 +0000)]
Patch autosetup to rename --debug to --autosetup-debug so we can use --debug/--enable-debug for its historical purpose. --with-debug is now an alias for --enable-debug but can be removed entirely if all scripts which have been adjusted for the autosetup build are edited to (re)use the older flag name.
drh [Fri, 22 Nov 2024 17:41:00 +0000 (17:41 +0000)]
Fix another issue in argument expansion on Windows for tclsqlite3.c in
interpreter mode. Problem introduced by check-in [9b87ea219bce5689] and
unfixed by [cd942dce148c9d8f].
stephan [Fri, 22 Nov 2024 16:45:43 +0000 (16:45 +0000)]
Remove a flaky JS test which has a result depending on unrepredictable context. That same feature is more reliably tested at a later point in the same script.
stephan [Fri, 22 Nov 2024 16:24:55 +0000 (16:24 +0000)]
In order to support package builds, like OpenBSD's, which set a custom soname on libsqlite3.so, extend the --soname configure flag to allow arbitrary soname values.
stephan [Fri, 22 Nov 2024 14:18:23 +0000 (14:18 +0000)]
Move handling of the tempstore feature flag into the OPT_FEATURE_FLAGS list and remove the CFLAGS.libsqlite3 makefile var which exists solely to account for the tempstore being tracked separately from the other feature flags.
stephan [Fri, 22 Nov 2024 13:47:12 +0000 (13:47 +0000)]
Remove the libsqlite3.so.3 link from the installation process, as it now serves no functional purpose. We retain libsqlite3.so.0 (A) for compatibility with clients linked against legacy builds and (B) 0 is still valid as the library's ABI version.
drh [Wed, 20 Nov 2024 16:21:34 +0000 (16:21 +0000)]
New configuration option --dynlink-tools causes some command-line tools like
sqldiff and sqlite3_analyzer to link against the libsqlite3.so system library
rather than being built-in. Caution: sqlite3_analyzer requires the
SQLITE_ENABLE_DBSTAT_VTAB compile-time option on its SQLite library in order
to work, so do not use --dynlink-tools to build sqlite3_analyzer without it.
drh [Wed, 20 Nov 2024 14:59:32 +0000 (14:59 +0000)]
Bug fix in the SubrtnSig logic from [c9a3498113074bbc], if a subquery is
copied and then changes are made to the copy, be sure to give the copy
a unique Select.selId value so that the original will not be substituted
in place of the modified copy.
[forum:/forumpost/0b9ded2f8428ac00|Forum post 0b9ded2f8428ac00].
drh [Wed, 20 Nov 2024 11:34:16 +0000 (11:34 +0000)]
Do not report an sqlite3_error_offset() for errors that occur inside of
views or triggers, since the text of those elements is not part of the
original query.
stephan [Tue, 19 Nov 2024 19:47:51 +0000 (19:47 +0000)]
Get sqlite3_analyzer optionally linking against libsqlite3.so instead of embedding sqlite3.c. Patch mkccode.tcl to accept digits in its IFDEF/IFNDEF checks and sqlite3_analyzer.c.in to only include sqlite3.c if -DINCLUDE_SQLITE3_C is passed to mkccode.tcl.
drh [Tue, 19 Nov 2024 18:26:47 +0000 (18:26 +0000)]
Enhancements to tool/mkccode.tcl such that it recognizes -D command line
arguments and can use them in internal IFDEF and IFNDEF macros. Update
the tool/sqlite3_analyzer.c.in script such that it omits the SQLite amalgamation
if -DSQLITE_ENABLE_DBSTAT_VTAB is defined.
stephan [Tue, 19 Nov 2024 17:41:13 +0000 (17:41 +0000)]
Revert linking the shell to the dll for reasons explained in new makefile comments. Move the --with-debug configure flag into the developer options set and add commentary about why it should never be used for production builds.
stephan [Tue, 19 Nov 2024 16:40:49 +0000 (16:40 +0000)]
Reformulate sqldiff deps and rules so that the target matches the resulting file name, to avoid rebuilding it on every make invocation. Apply the same treatment to the sqlite3 CLI shell.
stephan [Tue, 19 Nov 2024 15:20:47 +0000 (15:20 +0000)]
Initial configure support for linking certain binaries to libsqlite3.so instead of embedding it dynamically (which they typically do). This currently applies only to sqldiff, but support for adding the same for other tools is planned. This requires disabling the soname because setting it causes the build to link to whatever libsqlite3.so.0 is installed system-wide, so the soname now defaults to off.
stephan [Sun, 17 Nov 2024 09:49:53 +0000 (09:49 +0000)]
buildtclext.tcl: add docs explaining the DESTDIR check and break out of the auto_path search loop early if the DESTDIR is not writable, rather than re-checking that repeatedly.
drh [Sat, 16 Nov 2024 17:39:34 +0000 (17:39 +0000)]
Fix argument expansion in sqlite-tclsh on Windows such that if an argument
does not match a filename even after glob expansion, it is appended to the
argument list verbatim.
stephan [Sat, 16 Nov 2024 17:09:55 +0000 (17:09 +0000)]
Handle DESTDIR at an earlier phase in buildtclext.tcl to account for the is-writable-dir check and to filter out //zipfs: dirs as (im)possible installation targets.
drh [Fri, 15 Nov 2024 20:39:41 +0000 (20:39 +0000)]
Enhance the vfstrace extension such that the output can be controlled using
the "PRAGMA vfstrace('...');" statement. See header comment on the source code
for details.
stephan [Fri, 15 Nov 2024 19:42:49 +0000 (19:42 +0000)]
In the interest of minimizing downstream disruption, set the soname of libsqlite3.so to (by default) its legacy value of libsqlite3.so.0 and unconditionally create (or replace) a symlink with that name at install-time, in addition to the newer-named symlinks.
stephan [Fri, 15 Nov 2024 15:31:13 +0000 (15:31 +0000)]
buildtclext.tcl: work around a case, reported in [forum:0683a49cb02f31a1|forum post 0683a49cb0], in which package maintainers edit their copy of tclConfig.sh to change the TCL_SHLIB_LD command.
stephan [Fri, 15 Nov 2024 10:07:57 +0000 (10:07 +0000)]
An experiment in optionally using pkg-config to determine the libs to link in for ICU support, but its ldflags is missing one required lib on both Linux and OpenBSD. Keeping this for later reference, as it demonstrates how to use pkg-config from autosetup.
stephan [Thu, 14 Nov 2024 19:34:28 +0000 (19:34 +0000)]
Fix typo in the handling of the new --dev flag which caused it to set the --debug flag instead of the --with-debug flag (the former is for autosetup's internal use).
stephan [Thu, 14 Nov 2024 19:25:23 +0000 (19:25 +0000)]
Remove $prefix/include from the default -I path because it can cause the build to pick up an unintended copy of sqlite3.h. Extend the ICU configure support (the origin of -I$prefix/include) to enable fetching the -I path from icu-config and apply it only to those objects which need it.
drh [Thu, 14 Nov 2024 19:06:00 +0000 (19:06 +0000)]
Add new makefile target "sqlite3d" (where the "d" means either "development" or
"debug") that always uses separate source files, regardless of the
--disable-amalgmation setting.
drh [Wed, 13 Nov 2024 18:04:49 +0000 (18:04 +0000)]
Fix a memory leak in the ".dump" command of the CLI that can occur if an
error other than database corruption is seen while trying to query the
database.
drh [Tue, 12 Nov 2024 13:37:00 +0000 (13:37 +0000)]
Ensure that the sqlite3_index_info.idxStr string coming back from FTS5
is always zero-terminated, even if the xBestIndex call fails with an
SQLITE_CONSTRAINT error.
drh [Mon, 11 Nov 2024 21:11:02 +0000 (21:11 +0000)]
Clarify the documentation to make it clear that rows inserted by a
CREATE TABLE AS SELECT statement are not counted by sqlite3_count64().
[forum:/forumpost/1e6cde5648|Forum post 1e6cde5648].
stephan [Mon, 11 Nov 2024 18:15:50 +0000 (18:15 +0000)]
Wrap some exceptionally long lines in main.mk. Add option to override LDFLAGS on the sqlite3.dll target. Audit: all targets for which it is hypothetically relevant can now inherit user-supplied LDFLAGS, but only those provided to the configure script, not at make-time, in order to mimic the historical build's restriction in that regard.
drh [Mon, 11 Nov 2024 17:02:29 +0000 (17:02 +0000)]
Use Win32 APIs to read/write the console in Windows unless the
SQLITE_USE_STDIO_FOR_CONSOLE option is defined. This is an attempt to get
the build working on MinGW.
stephan [Sat, 9 Nov 2024 10:23:04 +0000 (10:23 +0000)]
Simplify usage of proj-assert by making the expr prefix implicit. Add an optional description arg to proj-assert, defaulting to the body of the assertion script.
drh [Fri, 8 Nov 2024 20:57:45 +0000 (20:57 +0000)]
Increase the minimum SQLITE_LENGTH_LIMIT from 1 to 30 to avoid problems doing
simple things like converting strings into integers. See also
[8fd5b8ec4ab9b555].