drh [Mon, 29 Jan 2024 12:58:12 +0000 (12:58 +0000)]
When rendering JSONB back into text JSON, report an error if a zero-length
integer or floating-point node is encountered. Otherwise, if the node occurs
at the very end of the JSONB, the rendering logic might read one byte past
the end of the initialized part of the BLOB byte array. OSSFuzz 66284.
drh [Tue, 23 Jan 2024 16:17:00 +0000 (16:17 +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.
drh [Tue, 23 Jan 2024 13:53:45 +0000 (13:53 +0000)]
When a JSON input is a blob, but it looks like valid JSON when cast to text,
then accept it as valid JSON. This replicates a long-standing bug in the
behavior of JSON routines, and thus avoids breaking legacy apps.
stephan [Tue, 16 Jan 2024 14:28:59 +0000 (14:28 +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.
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.
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.