dan [Wed, 12 Apr 2023 17:40:44 +0000 (17:40 +0000)]
Add the 'secure-delete' option to fts5. Used to configure fts5 to aggressively remove old full-text-index entries belonging to deleted or updated rows.
New assert() statements to validate the parameters to
sqlite3BtreeCursorHint(). Fix a problem with the construction of those
parameters discovered by
[forum:/forumpost/0b53708c95|forum post 0b53708c95].
Optimizations to btree.c save about 4.5 million CPU cycles:
(1) Clone insertCell() into a separate insertCellFast() routine for
use by sqlite3BtreeInsert(). (2) Mark allocateSpace() as always-inline.
(3) Improved coalesence of adjacent free blocks in pageFreeArray().
Work around a harmless assertion fault associated with
sqlite3VdbeMemAboutToChange() such that the detection of stale values
in registers is preserved in debugging builds, but we avoid a false-positive
assertion fault in cases involving a virtual table with a LIMIT clause
in an IN-operator loop.
dbsqlfuzz 3fd70d4ab4950acf1deb8f610a7a7c67cd38713b
A prepared statement that aborts due to SQLITE_SCHEMA should not invalidate
cursors in other prepared statements that are already running.
See [forum:/forumpost/cae4367d9b|forum post cae4367d9b] for the original
trouble report.
In the CLI, during error processing while looking for a word boundary,
avoid being deceived by malformed input that has a very long sequence
of 0x80 characters.
[forum:/forumpost/ab93a23ba1|forum post ab93a23ba1].
In the new .scanstatus command in the CLI, make sure the database is opened
before invoking sqlite3_db_config().
[forum:/forumpost/6e26dcf544|Forum post 6e26dcf544].
Fix the function that determines the collating function for an expression
tree to handle new cases that arise as a result of the recently added
ability to use indexed expressions in aggregate queries.
[forum/forumpost/0713a16a44|Forum post 0713a16a44].
Remove an assert() statement that is no longer valid due to enhancements
to query planner for improved use of indexes.
[forum:/forumpost/dc16ec63d3 |Forum post dc16ec63d3].
When translating arguments of aggregate functions into references to
expression indexes, make sure to only translate them for the current
aggregate when there are nested aggregates.
[forum/forumpost/409ebc7368|Forum post 409ebc7368].
When changing a COLLATE expression node into TK_AGG_COLUMN because the nodes
value is contained in an indexed expression, be sure to clear the
EP_Collate property from the expression node. Fix for the assertion faults
reported by [forum:/forumpost/e45108732c|forum post e45108732c] and
[forum:/forumpost/44270909bb|forum post 44270909bb].
Add the SQLITE_VTAB_USES_ALL_SCHEMAS option to sqlite3_vtab_config(). Update
the sqlite_dbpage, sqlite_dbdata, and sqlite_dbptr virtual tables to make
use of that interface. This was formerly handled by the internal
sqlite3VtabUsesAllSchemas() routine that was called directly from sqlite_dbpage.
But since sqlite_dbdata and sqlite_dbptr are an extension, an external
interface to that functionality had to be provided.
dbsqlfuzz 1a29c245175a63393b6a78c5b8cab5199939d6a8
With the -DSQLITE_ENABLE_JSON_NAN_INF compile-time option, non-standard
JSON numeric values "Inf", "Infinity", "-Inf", "-Infinity", "NaN", "QNaN",
and "SNaN" are all accepted. SQLite should never generate these values,
but it will accept that with the appropriate compile-time option.
Allow special floating-point value names in JSON: "inf", "-inf", "infinity",
"-infinity", "nan", "qnan", and "snan". All are converted into valid JSON
values: 9e999, -9e999, or null. Requires the SQLITE_ENABLE_JSON_NAN_INF
compile-time option to operate.
Improved error messages from PRAGMA integrity_check. Identify the root of
the tree when a problem is found in a b-tree, making it easier to track the
problem to a specific table or index.
drh [Wed, 29 Mar 2023 11:36:24 +0000 (11:36 +0000)]
Enhance PRAGMA integrity_check so that it can detect that a NOT NULL column
contains a NaN value and report that as an error.
dbsqlfuzz f144b642fe6f1a1c196f258ac6e60118a0cb59b2.
drh [Tue, 28 Mar 2023 16:02:28 +0000 (16:02 +0000)]
Fix a weird corner case in aggregate function processing that results from the
recent addition of support for index expressions on aggregate queries.
[forum:/forumpost/bad532820c|Forum post bad532820c].
drh [Tue, 28 Mar 2023 11:18:04 +0000 (11:18 +0000)]
Fix multiple problems with RETURNING on a DML statement against a view,
all inspired by [forum:/forumpost/dc3b92cfa0|forum post dc3b92cfa0].
(1) Do not allow a RETURNING clause to trick the code generator into thinking
that the view being updated has an INSTEAD OF trigger.
(2) Generate all result columns for a view in a DML statement.
(3) The automatic covering index for a view should cover all result columns
of the view.
stephan [Mon, 27 Mar 2023 13:57:08 +0000 (13:57 +0000)]
Remove a meaningless JS test. Add a timer to the OPFS async-side worker loader in an attempt to catch a browser-specific quirk in which the worker loading silently fails, per discussion in/around [forum post a708c98dcb3ef|forum:a708c98dcb3ef].
drh [Mon, 27 Mar 2023 13:24:02 +0000 (13:24 +0000)]
Do not allow constant factoring during PRAGMA integrity_check, since the
constants might be stored in registers that are later reused for other
purposes. dbsqlfuzz dc9ab26037cf5ef797d28cd1ae0855ade584216d. Problem
discovered by a new assert() statement added in [6f8b97f31a4c8552].
drh [Sun, 26 Mar 2023 16:36:27 +0000 (16:36 +0000)]
Improvements to register allocation, especially in the ANALYZE command.
New assert() statements added to help verify that memory allocation is
correct, and to help fuzzer find lingering errors.
drh [Sun, 26 Mar 2023 11:54:51 +0000 (11:54 +0000)]
Disable factoring of constant values during ANALYZE. This is a temporary
fix for [forum:/forumpost/07de5f6216|forum post 07de5f6216]. The register
allocation logic in ANALYZE needs to be completely refactored, but that will
take longer. This check-in will serve to resolve the issue until a better
fix can be devised.
drh [Sat, 25 Mar 2023 23:52:05 +0000 (23:52 +0000)]
When the left table of a RIGHT JOIN is used inside an aggregate function and the left table employs an index on expressions, then make sure the expressions evaluate to NULL for the cases where the left table should be NULL. Fix for
[forum:/forumpost/9b491e1deb|forum post 9b491e1deb].
drh [Sat, 25 Mar 2023 22:37:23 +0000 (22:37 +0000)]
When reading sqlite_stat4 data during query planning, be sure to expand
zeroblobs prior to running comparisons. Fix for the issue identified
by [forum:/forumpost/5275207102|forum post 5275207102].
drh [Sat, 25 Mar 2023 21:01:11 +0000 (21:01 +0000)]
When the left table of a RIGHT JOIN is used inside an aggregate function
and the left table employs an index on expressions, then make sure the
expressions evaluate to NULL for the cases where the left table should be
NULL. Proposed fix for [forum:/forumpost/9b491e1deb|forum post 9b491e1deb].
More testing an analysis needed - there is a FIXME in this check-in.
drh [Sat, 25 Mar 2023 19:44:25 +0000 (19:44 +0000)]
In the byte-code, when the result of an expression needs to be in a particular
register, always use the sqlite3ExprCode() routine because it has the smarts
to know whether to use OP_Copy or OP_SCopy. Do not try to OP_SCopy inline
because an OP_Copy might be required. Fix for the problem identified by
[forum:/forumpost/5522082cfc|forum post 5522082cfc].
drh [Sat, 25 Mar 2023 18:31:24 +0000 (18:31 +0000)]
The fix at [2bf5413dc2c19d5f] was incomplete in that it failed to clear
the reusable register cache that might contain registers in the STAT4
buffer region. This additional change corrects the problem.
[forum:/forumpost/83cb4a95a0|Forum post 83cb4a95a0]. Test case in TH3.
drh [Sat, 25 Mar 2023 03:17:08 +0000 (03:17 +0000)]
Tighter constraints on the maximum length of the filename handed over
to sqlite3_load_extension(), due to
[forum:/forumpost/a43074729e|forum post a43074729e]. This is a
follow-on to [01f3877c7172d522] and
[forum:/forumpost/08a0d6d9bf|forum post 08a0d6d9bf].
drh [Fri, 24 Mar 2023 21:35:48 +0000 (21:35 +0000)]
Fix possible integer overflow in bounds checking for the debugging function
"shell_int32()" found in the CLI. This change does not affect the core
SQLite. [forum:/forumpost/be9c294ee0|Forum post be9c294ee0].
drh [Fri, 24 Mar 2023 20:35:56 +0000 (20:35 +0000)]
Fix the handling of indexed expressions in an outer query that appear as
corelated values inside an aggregate function within a subquery.
[forum:/forumpost/79cf371080|Forum post 79cf371080].
drh [Fri, 24 Mar 2023 16:57:21 +0000 (16:57 +0000)]
Fix byte-code register allocation in ANALYZE for STAT4 when there multiple
indexes with differing numbers of columns.
[forum:/forumpost/bc39e531e5|forum post bc39e531e5].
drh [Thu, 23 Mar 2023 10:54:07 +0000 (10:54 +0000)]
The attempt to bring STAT4 up to 100% MC/DC at [55a26c67ed4a3a93] and
at [168fa2fb22b8c1ad] are incorrect. Back them out and replace them with
a simple NEVER() macro. Error reported by
[forum:/forumpost/dc4854437b|forum post dc4854437b].
drh [Wed, 22 Mar 2023 16:01:06 +0000 (16:01 +0000)]
In the CLI, the magic parameter :inf and :nan bind floating point values
Infinity and NaN, respectively, as an add to testing SQLite's handling of
those quantities.