stephan [Mon, 10 Feb 2025 15:58:22 +0000 (15:58 +0000)]
Add jimsh.exe and jimsh0.exe to the clean rules in Makefile.msc so that stale builds of those files from msys2 and friends do not cause mysterious build errors.
stephan [Mon, 10 Feb 2025 15:01:14 +0000 (15:01 +0000)]
configure: when dlopen() is not found, only fail fatally if --enable-loadable-module is explicitly provided, else warn instead. Based on discussion around [forum:2efe9c33bd9021ca|forum post 2efe9c33bd9021ca]. Update proj-indented-notice to behave like its docs say it should when the -error flag is used.
stephan [Sun, 9 Feb 2025 04:38:56 +0000 (04:38 +0000)]
configure: if the linker supports --out-implib, generate libsqlite3.X.a, where X is the platform's DLL file extension. Discussion in/around [forum:0c7fc097b2|forum post 0c7fc097b2].
stephan [Sun, 9 Feb 2025 04:16:01 +0000 (04:16 +0000)]
wasm: add some build-time validation to ensure that the problem fixed in [65798c09a00662a3] does not recur. Ensure that files generated via mkwasmbuilds.c have the generated makefile as a dependency.
stephan [Sun, 9 Feb 2025 03:24:00 +0000 (03:24 +0000)]
wasm: when building in -O0 mode (typical dev mode), use -sASSERTIONS=2, else -sASSERTIONS=0, in response [https://github.com/emscripten-core/emscripten/pull/23629/commits/7e3e35cbff9c5688eacb3cddc5045f872d744efd|Emscripten checkin 7e3e35cbff9], which adds assertions to check for the condition reported in [https://github.com/emscripten-core/emscripten/issues/23420|Emscripten ticket 23420]. Update some unrelated JS-side internal docs.
stephan [Sun, 9 Feb 2025 01:25:00 +0000 (01:25 +0000)]
configure: when transfering ENABLE/OMIT flags from CFLAGS to OPT_FEATURE_FLAGS, also do the same for CPPFLAGS and remove those ENABLE/OMIT flags from CFLAGS/CPPFLAGS to mimic legacy build behavior. Strip ENABLE/OMIT flags from BUILD_CFLAGS but do not transfer those to OPT_FEATURE_FLAGS, also to mimic legacy behavior. This is the second part of a fix discussed at [forum:9801e54665afd728|forum post 9801e54665afd728].
drh [Sat, 8 Feb 2025 14:15:42 +0000 (14:15 +0000)]
Use the sqlite3ColumnIndex() routine to look up a column in a table, rather
than using a custom loop. Performance improvement, size reduction, and
complexity decrease.
drh [Sat, 8 Feb 2025 11:15:41 +0000 (11:15 +0000)]
Improvements to the hash table used to store symbols in the schema, so that
it works better (requires fewer calls to sqlite3StrICmp()) for large schemas,
and uses less code space.
drh [Fri, 7 Feb 2025 19:09:20 +0000 (19:09 +0000)]
Fix comments on the Parse.nMaxArgs field so that they are correct. Add
assert()s to ensure they are correct. Other Parse changes to reduce the
amount of memset() needed to initialize it.
stephan [Fri, 7 Feb 2025 12:58:09 +0000 (12:58 +0000)]
configure: change extension of static libraries from .lib to .a on msys/cygwin, as per discussion in [forum:02db2d4240|forum post 02db2d4240]. Replace unidiomatic JS-style use of inner procs in autosetup/proj.tcl with TCL lambdas.
stephan [Fri, 7 Feb 2025 12:33:48 +0000 (12:33 +0000)]
Reorder a piece of ext/wasm/GNUmakefile to correct the timing of various var accesses. Fixes a problem [https://github.com/sqlite/sqlite-wasm/pull/99|reported in the downstream npm subproject] and explains the confusion in [4aa025a943a4024094b9] (which has been reverted).
stephan [Thu, 6 Feb 2025 13:18:49 +0000 (13:18 +0000)]
Fix a dependencies/order-of-operations bug in ext/wasm/GNUmakefile which causes creation of files filtered via c-pp to fail if the ext/wasm/jswasm dir did not exist beforehand.
stephan [Mon, 3 Feb 2025 17:34:12 +0000 (17:34 +0000)]
Rework [76c8435a] to eliminate automatic JS-to-WASM function conversions of sqlite3_set_auxdata() destructors because it can leads to leaks on every call of a UDF. This feature never worked before [76c8435a] but fixing it was ill-conceived because of the memory leakage it introduces. WASM function pointers can still be used as destructors in this context.
stephan [Mon, 3 Feb 2025 14:55:56 +0000 (14:55 +0000)]
Add a more complete test for [76c8435a] and add some commentary about (A) the inability to automatically clean up automatically-generated WASM proxy functions for sqlite3_set_auxdata() destructors and (B) how to deal with (A) to avoid leaking WASM proxy functions.
drh [Mon, 3 Feb 2025 14:44:16 +0000 (14:44 +0000)]
Fix the build process on Windows so that it generates identical sqlite3.c,
sqlite3.h, and shell.c files on Windows and Unix. This patch also includes
a change to JS bindings that got caught up in the branch.
stephan [Mon, 3 Feb 2025 14:04:27 +0000 (14:04 +0000)]
Correct the FuncPtrAdapter signature for the JS binding of sqlite3_set_auxdata(). Reported in [https://github.com/sqlite/sqlite-wasm/issues/92|the npm subproject, ticket #92].
stephan [Fri, 31 Jan 2025 11:45:55 +0000 (11:45 +0000)]
Correct a typo in tool/emcc.sh.in which could cause all of the configure-time work to locate the emcc binary to go unused. Reported in [forum:feb325cdde5b6f37|forum post feb325cdde5b6f37].
stephan [Thu, 30 Jan 2025 11:19:16 +0000 (11:19 +0000)]
Fix build regression, introduced in [d2fe6b05f38d9d] (3.48.0), in which SQLITE_OMIT and SQLITE_ENABLE flags passed to configure via CFLAGS were not propagated to the OPT_FEATURE_FLAGS list. Reported in [forum:9801e54665afd728|forum post 9801e54665afd728].
dan [Wed, 29 Jan 2025 18:53:19 +0000 (18:53 +0000)]
Fix bug in sessions handling of FK constraints introduced by [e09a0c02] (released in 3.48.0). Bug was preventing a changeset containing FK violations from being applied even when the xConflict(CHANGESET_FOREIGN_KEY) returned OMIT.
drh [Tue, 28 Jan 2025 20:32:48 +0000 (20:32 +0000)]
Enhance the if() and iif() SQL functions so that they support any
number of arguments greater than or equal to two.
Suggested by [forum:/forumpost/40f7867f75f80|forum post 40f7867f75f80].
drh [Tue, 28 Jan 2025 01:10:45 +0000 (01:10 +0000)]
Apparently I got the logic of [abfe488ed67e2e35] confused, even backwards.
Change it so that the SQLITE_USE_W32_FOR_CONSOLE_IO macro causes Win32 APIs
to be used for console I/O and for stdio to be used otherwise. This is
reported to be necessary for builds that use a C-language runtime other than
the one provided by Microsoft. This changes if for Windows only. It is a
bug fix, though we don't have a test case that will demonstrate a malfunction.
drh [Tue, 28 Jan 2025 00:48:01 +0000 (00:48 +0000)]
Remove an ALWAYS() in the star-query heuristic that is sometimes false if you
have a corrupt database. dbsqlfuzz c37ba7728d79859b79c8341b59297e88fba017d3.
Test case in TH3.