dan [Wed, 20 Aug 2025 15:42:23 +0000 (15:42 +0000)]
Avoid returning SQLITE_ERROR_RETRY if collation sequences associated with the table's PK cannot be found when creating an index. Possible fix for [forum:aa61ab56ad | forum post aa61ab56ad].
dan [Wed, 20 Aug 2025 11:21:35 +0000 (11:21 +0000)]
Fix a problem with SQLITE_CHANGESET_CONFLICT conflicts caused by DELETE triggers within a call to sqlite3changset_apply_v2() with SQLITE_CHANGESETAPPLY_IGNORENOOP specified.
stephan [Wed, 20 Aug 2025 09:43:15 +0000 (09:43 +0000)]
In builds without HAVE_FCHMOD (e.g. WASI), make the chmod() of temp files a no-op, analog to how lack of HAVE_FCHOWN is handled, as discussed in [forum:98d5158d3fdd7a41 | forum post 98d5158d3f].
dan [Tue, 19 Aug 2025 21:35:23 +0000 (21:35 +0000)]
Fix a problem causing an SQLITE_CHANGESET_DATA conflict of a DELETE operation to be incorrectly ignored if the SQLITE_CHANGESETAPPLY_IGNORENOOP is specified.
drh [Mon, 11 Aug 2025 13:17:10 +0000 (13:17 +0000)]
The off-by-one fix at [3e627d66ebdef8df] is insufficient. An index
can hold twice as many columns as a table, if the table is a WITHOUT ROWID
table. The limit should be twice the maximum, not just one more than the
maximum. Problem discovered by OSSFuzz.
stephan [Thu, 7 Aug 2025 20:20:22 +0000 (20:20 +0000)]
Add an explicit call to sqlite3_initialize() to sqlite3_rsync so that it works when built with SQLITE_OMIT_AUTOINIT, as suggested in [forum:c4ec6b33097b8536 | forum post c4ec6b33097b8536].
stephan [Wed, 6 Aug 2025 19:16:16 +0000 (19:16 +0000)]
Skip checking for dlopen() on mingw builds and those which include "windows" in their host tuple, as suggested in [forum:2436c8ffed | forum post 2436c8ffed]. Those environments identify as Windows for SQLite's purposes so use LoadLibrary().
drh [Tue, 5 Aug 2025 23:01:31 +0000 (23:01 +0000)]
Fix a possible printf() of a NULL string in fuzzcheck. (Passing a NULL to
"%s" in SQLite's internal printf() prints the text
"NULL", but it apparently segfaults glibc. Whatever.)
[forum:/forumpost/e07d56579b|Forum post e07d56579b].
drh [Tue, 5 Aug 2025 12:01:43 +0000 (12:01 +0000)]
Remove the <i>experimental</i> lsm1 extension from trunk, in as much as
readers were thinking that this was a supported extension and were reporting
bugs against it.
drh [Tue, 5 Aug 2025 10:54:56 +0000 (10:54 +0000)]
Add bounds checking and error messages and improved comments
to the (unused) zorder extension function.
[forum:/forumpost/e3f1ede174|Forum post e3f1ede174]
drh [Mon, 4 Aug 2025 23:05:35 +0000 (23:05 +0000)]
When doing an indexed row-value comparison using an IN operator where the
order of the columns in the row-value need to be rearranged in order to match
the index, be sure to make affinity conversions before the rearranging of
columns so that the correct affinity is applied. Fix for the bug
reported by [forum:/forumpost/eab63506cf|forum post eab63506cf]. This
problem goes back almost nine years to [ddb5f0558c445699].
stephan [Sun, 3 Aug 2025 08:56:16 +0000 (08:56 +0000)]
Add a note to sqlite3_deserialize() that a schema name of NULL implies the main db, a former shortcoming pointed out in [forum:0543d8aa8e|forum post 0543d8aa8e].
stephan [Sat, 2 Aug 2025 15:04:50 +0000 (15:04 +0000)]
Fiddle: move the About button into the main toolbar. Extend the About text with some info which only shows up (or is only hidden) when terminal mode is available.
stephan [Sat, 2 Aug 2025 14:50:01 +0000 (14:50 +0000)]
Fiddle: make the toolbar visible in terminal mode and hide non-terminal-mode options when in terminal mode. Move the terminal/split-view toggle button into the toolbar. Improve the view-switching handling.
stephan [Sat, 2 Aug 2025 12:06:37 +0000 (12:06 +0000)]
Fiddle: add an about/info/help view and a button to toggle it. Change the color schema to a more conventional black/white. Force imported databases out of WAL mode, which doesn't work in fiddle.
Ensure that stack space allocated for a flexible array has the correct
alignment. Fix to [d4307a0d43f42e96] to for some compilers
(DeveloperStudio) and platforms (Sparc).
stephan [Wed, 30 Jul 2025 16:17:14 +0000 (16:17 +0000)]
JS: ensure that sqlite3WorkerPromiser.v2.defaultConfig initially refers to sqlite3WorkerPromiser.defaultConfig. This fixes a longstanding oversight rather than a known in-the-wild problem.
stephan [Wed, 30 Jul 2025 15:02:32 +0000 (15:02 +0000)]
Adjust the previous check-in to replace the db's WASM address with yet another random number, and increase the range of random numbers, reducing the chance of cross-worker db ID collision to 1 in many billions.
stephan [Wed, 30 Jul 2025 14:50:44 +0000 (14:50 +0000)]
JS: add a random element when assigning db IDs to Worker1 db instances. This addresses [https://github.com/sqlite/sqlite-wasm/issues/113 | the npm project's ticket #113], which demonstrates that two independent workers can end up generating non-globally-unique IDs. That's not a bug, per se, but it makes the IDs useless for client-side mapping of db connection IDs to client-side state, so we add some randomness to them.
Enhance the printf formatter for %#f such that the minus sign is omitted
if the '+' is missing and all digits shown in the rendering are zero.
Thus, for example, '%#.2f' renders -0.004 as "0.00" instead of "-0.00".
Do not apply the [/info/e33da6d5dc964db8|EXISTS-to-JOIN optimization] if
the subquery contains a LIMIT clause.
[forum:/forumpost/2025-07-23T10:59:14z|forum post 2025-07-23T10:59:14z].
Fix a potentially uninitialized field in the WhereLoop object that is used
as part of the skip-ahead-distinct optimization. This fixes various
[forum:/timeline?ymd=20250722&u=yxchen&vfx|recent forum reports from yxchen].
stephan [Sun, 20 Jul 2025 18:05:45 +0000 (18:05 +0000)]
Teach autoconf/tea/configure to be able to run from the canonical source tree so that a snapshot build or appropriate symlinks are not necessary in order to test the extension.
Split the (internal) sqlite3VdbeCheckFk() routine into two variants,
sqlite3VdbeCheckFkImmediate() and sqlite3VdbeCheckFkDeferred(), which
run faster than the combined general-purpose variant.
stephan [Fri, 18 Jul 2025 22:18:41 +0000 (22:18 +0000)]
Add SQLITE_SELFORDER1 to JS's sqlite3.capi namespace. It's only useful when built with an sqlite3.c which itself was created with -DSQLITE_ENABLE_ORDERED_SET_AGGREGATES, which the canonical build does not do but custom builds may.
Ensure that the accumulator for an aggregate always gets initialized,
even when the aggregate is on the right side of a LEFT JOIN and never
gets evaluated. This fixes a problem introduced by [663f5dd32d9db832]
and found by dbsqlfuzz. Test cases in TH3.
stephan [Wed, 16 Jul 2025 14:51:23 +0000 (14:51 +0000)]
In the wasm makefiles, replace X:=Y with X=Y because := has different semantics depending on the make impl and its use is arguably a bad muscle-memory habit worth breaking. These makefiles are very specifically for GNU make, but long-term it would be nice to eliminate that requirement.
stephan [Wed, 16 Jul 2025 13:22:38 +0000 (13:22 +0000)]
wasm: remove some extraneous levels of makefile var and fix the (unsupported) wasmfs speedtest1 build to account for var renaming which happened long before this.
stephan [Wed, 16 Jul 2025 11:56:16 +0000 (11:56 +0000)]
Remove an unnecessary step from the wasm builds and account for a recent Emscripten-internal code-generation change which caused a post-build cleanup step to not actually clean up (harmless, but adds about 26k of useless stuff to the resulting JS).
stephan [Wed, 16 Jul 2025 10:34:14 +0000 (10:34 +0000)]
Internal refactoring of the WASM build makefile rule generator, working towards parallelizing the various build modes (which is not currently possible because most modes share the same sqlite3.wasm output file name).
stephan [Wed, 16 Jul 2025 09:27:55 +0000 (09:27 +0000)]
Teach the sqlite3 CLI shell to look in XDG_STATE_HOME for the CLI history file before falling back to its historical location in the user's home directory.
dan [Tue, 15 Jul 2025 19:00:01 +0000 (19:00 +0000)]
Avoid evaluating special vtab operators (e.g. MATCH) that are part of ON clauses attached to left joins from being evaluated too early. Fix for [forum:/forumpost/428ef7c468 | forum post 428ef7c468].
Enhance the "mktoolzip.tcl" script (used by the "tool-zip" makefile target) so that
it uses "fossil test-filezip" to build the ZIP archive if available, and so that
it also generates windows-dll-*.zip on Windows platforms.
dan [Mon, 14 Jul 2025 15:40:25 +0000 (15:40 +0000)]
In rtree.c, ensure that the pReadAux statement is reset whenever the bAuxValid flag is cleared. Fix for [forum:/forumpost/3e45ed31d8 | forum post 3e45ed31d8].
dan [Mon, 14 Jul 2025 15:34:11 +0000 (15:34 +0000)]
In rtree.c, ensure that the pReadAux statement is reset whenever the bAuxValid flag is cleared. Possible fix for [forum:/forumpost/3e45ed31d8 | forum post 3e45ed31d8].
dan [Mon, 14 Jul 2025 14:51:43 +0000 (14:51 +0000)]
Add new sessions function sqlite3changeset_apply_v3() and its streaming equivalent. This allows changesets to be filtered on a per-change basis, not just per-table.
dan [Sat, 12 Jul 2025 18:14:41 +0000 (18:14 +0000)]
Avoid evaluating special vtab operators (e.g. MATCH) that are part of ON clauses attached to left joins from being evaluated too early. Possible fix for [forum:/forumpost/428ef7c468 | forum post 428ef7c468].
stephan [Fri, 11 Jul 2025 19:52:36 +0000 (19:52 +0000)]
wasm: introduce the sqlite3.oo1.DB.wrapHandle() and Stmt.wrapHandle() APIs, which enable clients to wrap (sqlite3*) resp. (sqlite3_stmt*) pointers in their oo1 API counterparts, optionally with or without taking over ownership of the pointer.