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].
stephan [Fri, 8 Nov 2024 13:37:00 +0000 (13:37 +0000)]
Add 'tcl' makefile target which builds all but tclextension (which does not have a well-defined name and dependencies). Improve the deps for .tclenv.sh to avoid getting a stale tclsh when re-configuring with a different --with-tcl(sh).
stephan [Fri, 8 Nov 2024 07:37:12 +0000 (07:37 +0000)]
More closely emulate the legacy build's handling of LDFLAGS, permitting them to be passed to configure but not to make. We cannot 100% enforce that because main.mk is not filtered by the configure script, so we instead add a level of indirection to make passing of LDFLAGS=... to make a no-op.
stephan [Fri, 8 Nov 2024 06:22:15 +0000 (06:22 +0000)]
Support clients passing in LDFLAGS to configure/make, but in a more limited form than the legacy build it (i.e. only to select targets rather than all targets). Rename make-side internal uses of CFLAGS to CFLAGS.env for consistency with the new LDFLAGS.env. See discussion in [forum:5fcbea40f3|forum thread 5fcbea40f3].
stephan [Fri, 8 Nov 2024 05:26:26 +0000 (05:26 +0000)]
Disable setting of the SONAME (enabled by [2a2419ef742]), as it's not clear whether blindly setting the SONAME, which now differs from its historical value, will cause more grief than it solves. Add a (disabled) experiment which permits setting (or not) the SONAME to the legacy or current values. This change is up for further change as experimentation proves whether we truly need/want the SONAME. See discussion in/around [forum:0c6fc6f46b2cb3|forum post 0c6fc6f46b2cb3].
stephan [Thu, 7 Nov 2024 15:04:15 +0000 (15:04 +0000)]
tcl configuration: --with-tcl=prefix is equivalent to passing the --prefix dir to it. If --with-tcl or --enable-tcl are explicitly passed in and tclConfig.sh is not found, fail fatally. When TCL is either explicitly disabled or default search for it fails non-fatally, be more explicit about which components are not available.
stephan [Thu, 7 Nov 2024 07:31:25 +0000 (07:31 +0000)]
When --with-linenoise refers to the msteveb flavor and jimsh is the TCL used for code generation, enable linenoise in jimsh. Remove some dead auto.def code.
stephan [Thu, 7 Nov 2024 05:26:09 +0000 (05:26 +0000)]
For platforms where tclsh is found but tclConfig.sh is not, set HAVE_TCL to 0. We can't build the TCL components on those. Problem reported in [forum:5106aee3a8|forum post 5106aee3a8].
drh [Wed, 6 Nov 2024 19:19:49 +0000 (19:19 +0000)]
Fix an FTS3 corruption test case that depends on the specific pseudo-random
byte sequence generated by sqlite3_randomness(), which is different on
big-endian platforms than it is on little-endian platforms.
stephan [Wed, 6 Nov 2024 04:38:05 +0000 (04:38 +0000)]
Add autosetup/README.md - maintenance-related docs for SQLite developers (e.g. how to update autosetup). Start marking up the proj.tcl APIs with autosetup's doc markup so that they appear in the ./configure --reference output.
stephan [Wed, 6 Nov 2024 02:59:59 +0000 (02:59 +0000)]
Enhance the --with-emsdk flag to use a default value of 'auto', meaning to search the environment for it, and to fail fatally if --with-emsdk is explicitly provided but the SDK is not found.
stephan [Tue, 5 Nov 2024 13:34:30 +0000 (13:34 +0000)]
Work around a TCL {list-quoting} quirk when escaped/deferred var derefs are passed in as values to the autotools-conventional --XYZdir flags (as seen in a downstream package build script).
stephan [Tue, 5 Nov 2024 09:49:53 +0000 (09:49 +0000)]
auto.def: remove an extraneous global var, some dead tcl/makefile code/comments, and some extraneous output. Rename an internal-use proc. Disable the ext/wasm cleanup in the top-level (dist)clean because the noise from gmake is irritating.
stephan [Tue, 5 Nov 2024 02:38:32 +0000 (02:38 +0000)]
Change a (#define HAVE_FCHMOD) to (#define HAVE_FCHMOD 1) per user request in [forum:24cf6020c6|forum post 24cf6020c6]. There's no semantic change for this tree, but this is consistent with how auto-config tools would define it and the empty #define interferes with some downstream code.
drh [Mon, 4 Nov 2024 19:08:53 +0000 (19:08 +0000)]
Ensure that the database encoding is detected before the code generator gets
too far down into byte-code generation and execution, but not so early that
it interferes with initialization.
[forum:/forumpost/bc75a4d20b756044|Forum thread bc75a4d20b756044].
stephan [Mon, 4 Nov 2024 08:29:02 +0000 (08:29 +0000)]
When installing the shared lib, re-activate the accommodation of legacy-style .so links (removed in [80584e165e4]) based on two reports that not having those will cause all clients linked against the legacy naming convention to fail to dynamically link (which would preclude an update of a system-level libsqlite3 package). Set up the infrastructure needed for adding an SONAME to the library but do not yet activate it. See discussion in/around [forum:046133a7da|forum post 046133a7da].
stephan [Mon, 4 Nov 2024 05:27:21 +0000 (05:27 +0000)]
Latest upstream autosetup to get handling of (==ignoring) autotools' x-includes and x-libraries flags and stop leakage of some autosetup-init-level vars into auto.def's global scope.
stephan [Sun, 3 Nov 2024 19:42:41 +0000 (19:42 +0000)]
If any autotools-conventional dir names are explicitly overridden via ./configure --dirname=X then export those names as-is to the makefile, otherwise derive them from $prefix. This is, at least in part, a compromise to provide package maintainers a way to specify a libdir which will be incorporated into the -rpath link flag (which we can only determine at configure-time).
stephan [Sun, 3 Nov 2024 18:30:45 +0000 (18:30 +0000)]
Workaround for a compiler-specific jimsh compilation error reported in [forum:18e420d0b1404d63|forum post 18e420d0]. Reported upstream as [https://github.com/msteveb/jimtcl/issues/322|ticket #322].
stephan [Sat, 2 Nov 2024 05:50:22 +0000 (05:50 +0000)]
An experiment in hybridizing overriding of autotools-conventional XYZdir vars, the goal being to be able to provide both overrriding of them at configure-time and make-time with sensible semantics. Based on notes from [forum:00d12a41f7|forum post 00d12a41f7].
stephan [Sat, 2 Nov 2024 03:34:04 +0000 (03:34 +0000)]
Add autotools-compatible overridable dir name vars for the various installation targets, calculated at make-time instead of exported at configure-time for reasons explained at length in the accompanying comments.
stephan [Fri, 1 Nov 2024 01:56:27 +0000 (01:56 +0000)]
When configuring with --with-wasi-sdk, ensure that we use that SDK's 'ar' tool instead of whatever is in the PATH. When pushing/popping the define var scope for the jimsh compatility check, include more defines per consultation with autosetup's creator.
drh [Thu, 31 Oct 2024 17:23:40 +0000 (17:23 +0000)]
Extra defenses against UAF when failing to allocate a transient cursor. No
known path to a UAF currently exists. This change just helps with the static
analysis to prove it.
drh [Thu, 31 Oct 2024 11:53:18 +0000 (11:53 +0000)]
When building a shared library on Mac, one must specify the original *.o
files that go into that library. It does not work to specify a prior shared
library containing a subset of the files to be included.
stephan [Thu, 31 Oct 2024 08:03:35 +0000 (08:03 +0000)]
Remove some proj-assert checks which are not valid on OpenBSD. Ensure that queued up notices about TCL warnings are displayed before leaving sqlite-check-tcl.
stephan [Thu, 31 Oct 2024 07:20:22 +0000 (07:20 +0000)]
Add the .POSIX special target to the main makefiles to hint to the make impl that it should behave POSIXly-correct. Fix the default file extension for static libs in main.mk.
stephan [Thu, 31 Oct 2024 07:01:31 +0000 (07:01 +0000)]
Add more deps to T.tcl.env.sh so that it gets rebuilt if configure is run with a different --with-tcl value. Remove all references to the superfluous XYZdir makefile vars conventionally set by the autotools (they're just noise in this build).