Check-in a9657c87c53c1922 is wrong: the IndexedExpr.bMaybeNullRow flag is
required for virtual columns if they are part of an outer join. Add a
test case to prove it.
When compiling with SQLITE_ALLOW_ROWID_IN_VIEW, if the RETURNING clause of
an UPDATE of a view specifies a rowid, then return NULL for the value of
that rowid.
drh [Sun, 24 Mar 2024 21:15:01 +0000 (21:15 +0000)]
Fix the xBestIndex method of the pragma virtual table so that it correctly
gives a higher cost to plans where the schema hidden parameter is
unconstrained.
drh [Wed, 20 Mar 2024 15:26:30 +0000 (15:26 +0000)]
Following a ROLLBACK that reverts changes to an RTREE, any pending queries
against that same RTREE abort with code SQLITE_ABORT_ROLLBACK.
dbsqlfuzz de7d17b72d0e842352c998dd86a47b7d0f707be9.
drh [Wed, 20 Mar 2024 11:36:26 +0000 (11:36 +0000)]
Automatically disable the DISTINCT optimization during query planning if the
ORDER BY clause exceeds 63 terms.
dbsqlfuzz afd1d61fc27d14938a0d78a50970fa1e9fbfee58.
drh [Wed, 20 Mar 2024 11:24:11 +0000 (11:24 +0000)]
If a term of an ORDER BY or GROUP BY contains an aggregate function or column,
then it is not an alias that needs to be resolved, so don't try to. This fixes
a harmless assertion found by dbsqlfuzz.
drh [Wed, 20 Mar 2024 11:04:38 +0000 (11:04 +0000)]
Fix the SQLITE_ALLOW_ROWID_IN_VIEW bug-compatibility option so that it works
again. Add the SQLITE_CONFIG_ROWID_IN_VIEW sqlite3_config() value
to optionally disable the bug-compatibility mode at start-time. Enable
testing of SQLITE_ALLOW_ROWID_IN_VIEW.
drh [Tue, 23 Jan 2024 16:21:07 +0000 (16:21 +0000)]
In os_unix.c and os_win.c, do not allow xFetch() to return a pointer to a page buffer that is right at the end of the mapped region - if the database is corrupted in a specific way such a page buffer might be overread by several bytes.
stephan [Fri, 22 Dec 2023 15:42:09 +0000 (15:42 +0000)]
Update #ifdef checks in pager.c and util.c to account for [0462a2612d1fc1d0] to resolve the build problem reported in [forum:9819032aac|forum post 9819032aac].
drh [Tue, 19 Dec 2023 13:00:21 +0000 (13:00 +0000)]
When unable to resolve an identifier, change the Expr node into TK_NULL
rather than TK_COLUMN, to prevent any downstream misuse of the non-existent
column.
stephan [Tue, 12 Dec 2023 17:55:20 +0000 (17:55 +0000)]
Worker1 Promiser API: when multiple db connections are active then use the requested connection instead of always the first-opened connection. Bug reported in [forum:894c330e7f23b177|forum post 894c330e7f23b177].
dan [Mon, 11 Dec 2023 13:48:30 +0000 (13:48 +0000)]
Different fix for the fts5 COMMIT-following-OOM problem first fixed by [fba3129d]. This one does not cause problems if an fts5 table is renamed and then dropped within the same transaction.
stephan [Wed, 22 Nov 2023 17:13:27 +0000 (17:13 +0000)]
Correct the URL for loading sqlite3-worker1-bundler-friendly.mjs from sqlite3-worker1-promiser-bundler-friendly.js, so that the promiser can be used in bundler-using environments. Problem reported via email.
larrybr [Tue, 21 Nov 2023 18:46:17 +0000 (18:46 +0000)]
Pickup minor stylistic changes related to console I/O and, for Windows builds, get fact of UTF-16 translation into the sign-on banner. (a straight cherry-pick)
drh [Thu, 9 Nov 2023 17:42:46 +0000 (17:42 +0000)]
Add the SQLITE_RESULT_SUBTYPE flag for application-defined functions. Add
the -DSQLITE_STRICT_SUBTYPE=1 compile-time option that raises an error if
any function invokes sqlite3_result_subtype() without the SQLITE_RESULT_SUBTYPE
flag. SQLITE_RESULT_SUBTYPE prevents an indexed value of that function from
being used to replace an equivalent expression, since the indexed expression
does not carry the subtype.
drh [Tue, 7 Nov 2023 19:15:55 +0000 (19:15 +0000)]
Update the documentation to the sqlite3_set_auxdata() and sqlite3_get_auxdata()
routines to make it clear that they do not work as one might expect when they
are called during query planning, instead of during query execution. The JSON
routines misuse those interfaces, so add a special flag to JSON routines that
prevents them from being invoked during query planning.
drh [Mon, 6 Nov 2023 19:08:46 +0000 (19:08 +0000)]
Update the srctree-check.tcl script and child script so that they can be run
on a read-only source tree and so that if any inconsistencies are found, the
script returns a non-zero exit code and thus halts the build.
drh [Mon, 6 Nov 2023 19:01:25 +0000 (19:01 +0000)]
Fix an fts5 problem where a transaction consisting of (a) a DELETE on rowid X, (b) a prefix query, and (c) an INSERT on rowid X, could corrupt the index.
drh [Mon, 30 Oct 2023 19:03:17 +0000 (19:03 +0000)]
Add a cast to i64 for an integer in an sqlite3OsWrite() offset
calculation. The cast is not strictly necessary, but it helps human readers
see that the code is correct.
drh [Mon, 30 Oct 2023 12:09:48 +0000 (12:09 +0000)]
With SQLITE_ENABLE_BLOCK_ATOMIC_WRITE enabled, if a transaction is committing
and there is a new freelist page at the end of the database file which would
cause the database file size to grow, ensure that page is written and the
file size grows before the block-atomic-write commits. Fix for the
problem identified by [forum:/forumpost/3bd8d497b2|forum post 3bd8d497b2]
larrybr [Sun, 29 Oct 2023 16:26:12 +0000 (16:26 +0000)]
Properly close a handle. Use a putatively effective runtime test for UTF-8 console I/O capability. (This makes the version test useful mainly for avoiding a warning that UTF-8 console I/O could not be setup.)
larrybr [Sun, 29 Oct 2023 00:24:22 +0000 (00:24 +0000)]
Condition default UTF-8 console I/O for Windows builds on OS version 10 or more. This is to accomodate an IsValidCodePage() API which may happily report CP_UTF8 as a valid code page when the stock console cannot, in fact, do UTF-8 I/O.
drh [Sat, 28 Oct 2023 11:53:14 +0000 (11:53 +0000)]
Update documentation for sqlite3_errmsg() to try to make it clear that if
the schema of a database contains table names or similar with invalid UTF,
then the error message generated by SQLite might also contain invalid UTF.
No changes to code.
drh [Sat, 28 Oct 2023 11:40:33 +0000 (11:40 +0000)]
Since SQLite considers NaN to be like NULL and NULL sorts before any integer,
make sure the sqlite3IntFloatCompare() routine reports that the integer
argument is larger if the floating-point argument is NaN.
stephan [Sat, 28 Oct 2023 03:54:28 +0000 (03:54 +0000)]
Remove the SQLITE_MAX_ALLOCATION_SIZE flag (set to 536mb) from the WASM and JNI builds because it can unduly limit db exports via sqlite3_serialize(), as reported in [forum:75524f7342c1ba45|forum post 75524f7342c1ba45]. It now defaults to whatever sqlite3.c uses, which is currently just shy of 2gb.
drh [Fri, 27 Oct 2023 18:16:15 +0000 (18:16 +0000)]
Disable two rtree test cases for Linux-i686. We do not have that platform
available for testing. The test cases work on all other 64-bit and 32-bit
platforms that we have at hand. So there is no way for us to debug this
problem. Better to disable the test.
[forum:/forumpost/ffcbf789b5386573|forum post ffcbf789b5386573].
larrybr [Fri, 27 Oct 2023 13:59:05 +0000 (13:59 +0000)]
Cleanup shell.c comments. Hide -utf8 option, as it is undocumented and accepted only for backward compatibility. No functional changes except for -help content.
drh [Fri, 27 Oct 2023 10:49:17 +0000 (10:49 +0000)]
Back out [2904fcbeebba9189], mostly. The page bitmap is needed even for a
partial integrity_check in order to avoid an infinite loops while walking the
database.
drh [Thu, 26 Oct 2023 17:30:54 +0000 (17:30 +0000)]
Enhance the "tool-zip" makefile target on Windows so that it uses more
universally available commands to build the ZIP archive. Fix other minor
issues with that makefile target at the same time.
dan [Thu, 26 Oct 2023 16:05:57 +0000 (16:05 +0000)]
Handle the case where a virtual table xBestIndex method called while coding a trigger fired by a top-level statement with a RETURNING clause prepares a statement that also contains a RETURNING clause.