drh [Tue, 23 Jan 2024 13:21:40 +0000 (13:21 +0000)]
If a BLOB looks like JSON when cast to text, then treat it as if it really
were JSON. This replicates a long-standing bug in the JSON processing
routines, and thereby avoids breaking legacy.
drh [Mon, 22 Jan 2024 14:16:10 +0000 (14:16 +0000)]
The -DSQLITE_JSON_BLOB_INPUT_BUG_COMPATIBLE compile-time option causes blob
inputs to JSON functions that are not JSONB to be processed as if they
where text, immulating historical bugging behavior which some applications
have come to rely upon. See
[forum:/forumpost/012136abd5292b8d|forum thread 012136abd5292b8d] for
discussion.
drh [Mon, 22 Jan 2024 12:56:58 +0000 (12:56 +0000)]
Fix userauth so that it works together with SQLITE_OMIT_SHARED_CACHE.
([forum:/forumpost/0bfc5888a384d430|Forum post 0bfc5888a384d430]).
However, also change to code to issue a deprecation warning whenever
SQLITE_USER_AUTHENTICATION is used.
larrybr [Mon, 22 Jan 2024 01:11:24 +0000 (01:11 +0000)]
Make CLI .dump immune to pragma reverse_unordered_selects, as reported in [forum:/forumpost/c42be01880e961eb|Forum thread "Missing ORDER BY in .dump?"]
dan [Sat, 20 Jan 2024 18:41:13 +0000 (18:41 +0000)]
Ensure that values generated by DEFAULT clauses that specify real numbers that can be expressed as 64-bit integers (e.g. -1234.0) are not silently converted to integers.
drh [Sat, 20 Jan 2024 16:29:19 +0000 (16:29 +0000)]
Rig sqlite3_serialize() so that it will initialize a previously uninitialized
database prior to serializing it, so that it does not have a zero-byte size
and does not return NULL (except for OOM).
[forum:/forumpost/498777780e16880a|Forum thread 498777780e16880a].
drh [Sat, 20 Jan 2024 15:13:13 +0000 (15:13 +0000)]
When doing a text-affinity comparison between two values where one or both
have both a text and a numeric type, make sure the numeric type does not
confuse the answer. This is a deeper fix to the problem observed by
[forum:/forumpost/3776b48e71|forum pose 3776b48e71]. The problem bisects
to [25f2246be404f38b] on 2014-08-24, prior to version 3.8.7.
drh [Sat, 20 Jan 2024 13:18:22 +0000 (13:18 +0000)]
Ensure that the replace() SQL function always returns a TEXT value even
when its first argument is numeric and its second argument is an empty string.
Fix for the issue reported by
[forum:/forumpost/3776b48e71|forum post 3776b48e71].
drh [Sat, 20 Jan 2024 12:13:00 +0000 (12:13 +0000)]
When backing out a character in a constructed string in JSON, first make sure
the string has not been reset by on OOM.
dbsqlfuzz 2fffbea91a5376526ea118d4fe4188c8dd35e317.
drh [Sat, 20 Jan 2024 12:00:20 +0000 (12:00 +0000)]
Fix the version number in the TEA configure script. This should have
been changed by [1481baf3d55effcc] three check-ins ago.
It is unclear how testing missed this.
drh [Sat, 20 Jan 2024 00:31:44 +0000 (00:31 +0000)]
Implement a new algorithm for computing ISO week values in strftime() based
on the idea (from [forum/forumpost/3681cb1bcd|Nuno Cruces]) of shifting the
date being tested to the Thursday of the same week.
drh [Tue, 16 Jan 2024 14:54:54 +0000 (14:54 +0000)]
Remove the LLONG_MAX preprocessor macro from the series.c extension as it
is apparently only C99 and later.
[forum:/forumpost/4af649419b|Forum post 4af649419b].
stephan [Thu, 11 Jan 2024 16:10:22 +0000 (16:10 +0000)]
wasm build: reformulate an awk invocation to account for awks which do not support the -e flag. Problem reported on the forum via a docker-hosted build.
dan [Thu, 11 Jan 2024 14:03:08 +0000 (14:03 +0000)]
In fts5, flush the contents of the in-memory hash table whenever the secure-delete option is toggled. This prevents spurious corruption reports under some circumstances.
stephan [Thu, 11 Jan 2024 12:31:58 +0000 (12:31 +0000)]
Split the JS vfs/vtab helper code into discreet units as a step towards a build which optionally elides those pieces. This is an internal restructuring change and does not affect the API.
drh [Tue, 9 Jan 2024 23:15:46 +0000 (23:15 +0000)]
Put an SQLITE_ENABLE_SETLK_TIMEOUT branch inside the appropriate ifdef with
an assert on the else since the condition is always false if SETLK_TIMEOUT
is not available.
dan [Mon, 8 Jan 2024 19:55:40 +0000 (19:55 +0000)]
Automatically turn off DEFENSIVE mode in the shell tool when executing scripts generated by the ".dump" command against an empty database. Add a warning to the top of generated ".dump" scripts that populate virtual tables.
dan [Mon, 8 Jan 2024 18:46:34 +0000 (18:46 +0000)]
Automatically turn off DEFENSIVE mode in the shell tool when executing scripts generated by the ".dump" command against an empty database. Add a warning to the top of generated ".dump" scripts that populate virtual tables.
dan [Mon, 8 Jan 2024 13:38:15 +0000 (13:38 +0000)]
Ensure that SQLITE_PROTOCOL is not returned too early when a SQLITE_ENABLE_SETLK_TIMEOUT build fails to open a transaction on a wal mode database in cases where blocking locks are not being used.
stephan [Mon, 8 Jan 2024 07:52:47 +0000 (07:52 +0000)]
Make explicit which JS APIs are for internal use only by moving the JS-bound internal-use-only functions out of client-visible reach and renaming the WASM-exported ones from sqlite3_wasm... to sqlite3__wasm... (with two underscores). These have always been documented as internal-use-only, so this is not a breaking change except for clients which have ignored the docs.
dan [Sat, 6 Jan 2024 19:16:54 +0000 (19:16 +0000)]
Ensure that SQLITE_PROTOCOL is not returned too early when a SQLITE_ENABLE_SETLK_TIMEOUT build fails to open a transaction on a wal mode database in cases where blocking locks are not being used.
drh [Wed, 3 Jan 2024 12:26:02 +0000 (12:26 +0000)]
Update the sqldiff.exe utility program so that it uses the sqlite3_str
string interface, and so that it does console output using the
ext/consio extension.
drh [Mon, 1 Jan 2024 17:58:57 +0000 (17:58 +0000)]
Remove some unnecessary computations from ANALYZE so that ANALYZE runs with
fewer CPU cycles. These changes were spotted while working on the nearby
enhanced-stat1 branch. So even if enhanced-stat1 is abandoned, that effort
put into it will not have been in vain.
drh [Mon, 1 Jan 2024 17:48:02 +0000 (17:48 +0000)]
Extra steps taken to avoid using low-quality indexes in a query plan.
This branch accomplishes the same end as the nearby enhanced-stat1 branch,
but with much less change and hence less risk.
stephan [Mon, 1 Jan 2024 06:58:32 +0000 (06:58 +0000)]
JNI: move the ByteBuffer-using APIs from public to package visibility for the time being because they have UB-inducing possibilities which need to be worked out. Update test code to account for a change in custom FTS5 columntext() impls.
stephan [Mon, 1 Jan 2024 05:58:47 +0000 (05:58 +0000)]
WASM: various build cleanups and add initial infrastructure for a build which elides the oo1 API and its dependents (worker1 and promiser). Sidebar: an attempt was made to move generation of the build rules to an external script, but the mixed-mode make/script was even less legible than the $(eval) indirection going on in the makefile.
drh [Thu, 28 Dec 2023 16:21:22 +0000 (16:21 +0000)]
Enhance the (undocumented, debug-only) json_parse() SQL function so that it
returns the text rendering of the JSONB parse of the input, rather than printing
the rendering on stdout.
dan [Wed, 27 Dec 2023 16:24:53 +0000 (16:24 +0000)]
Fix a problem in the shell tool (not library) causing an out-of-bounds write if an ".open" command failed, then the user pressed ctrl-c to interrupt a query running on the substitute in-memory database.
drh [Sat, 23 Dec 2023 11:31:47 +0000 (11:31 +0000)]
Add debugging output routines sqlite3ShowWhereLoop(X) and
sqlite3ShowWhereLoopList(X) that can be invoked from a debugger to show
a summary of the content of a single WhereLoop object or a list of WhereLoop
objects. No change in release builds.
dan [Fri, 22 Dec 2023 16:03:45 +0000 (16:03 +0000)]
Add the -fno-sanitize-recover=undefined to the sanitizer builds used for sdevtest and release testing. To ensure that any test that provokes undefined behaviour fails.
stephan [Fri, 22 Dec 2023 15:41:13 +0000 (15:41 +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 [Fri, 22 Dec 2023 12:57:49 +0000 (12:57 +0000)]
Add a new comment to debugging output routine sqlite3WhereLoopPrint() to
remind us of what the various fields of the debug output mean. No changes
to code.
drh [Tue, 19 Dec 2023 12:49:35 +0000 (12:49 +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. dbsqlfuzz 71869261db80a95e4733afa10ff5724bf3c78592.