drh [Thu, 1 Jun 2023 20:38:22 +0000 (20:38 +0000)]
Generalize the LEFT JOIN strength reduction optimization so that it works for
RIGHT and FULL JOIN as well. Rename it to the "OUTER JOIN strength reduction"
optimization.
drh [Thu, 1 Jun 2023 16:40:28 +0000 (16:40 +0000)]
If the filename argument to sqlite3_load_extension() is an empty string, then
raise an error. It turns out that if dlopen() is called with an empty
filename, it tries to load the current executable. And then if the caller
requests some other function from the current executable, mischief can result.
drh [Tue, 30 May 2023 16:40:42 +0000 (16:40 +0000)]
Enhancements to date/time functions:
(1) Add support for time-shift modifiers of the form (+|-)YYYY-MM-DD HH:MM:SS.SSS
(2) Add the timediff(A,B) SQL function that returns the time-shift modifier
sufficient to move B to A.
stephan [Tue, 30 May 2023 14:10:28 +0000 (14:10 +0000)]
Minor tweak to the OPFS async proxy to attempt to account for a spurious high-load console error message which was reported via the sqlite-wasm npm project.
stephan [Thu, 25 May 2023 16:49:06 +0000 (16:49 +0000)]
Add ability for the JS Worker1.exec() API to report the number of changes made to the caller, per request in [forum:d0b19483642e20dd | forum post d0b19483642e20dd].
drh [Tue, 23 May 2023 15:16:20 +0000 (15:16 +0000)]
When converting an aggregate expression to AGG_COLUMN, be sure to remove
the EP_Unlikely flag if it is present.
[forum:/info/fbfe330a2009d036|Forum post fbfe330a2009d036].
drh [Mon, 22 May 2023 16:35:21 +0000 (16:35 +0000)]
When a floating-point RTREE is presented with large integer constraints -
integers that are too big to be represented exactly by a float - then take
extra steps to ensure that all possibly relevant entries in the RTREE are
returned, even in boundary cases. Fix for the problem identified by
[forum:/forumpost/da70ee0d0d|forum post da70ee0d0d].
stephan [Fri, 19 May 2023 18:23:53 +0000 (18:23 +0000)]
Extend detection of the INSERT...RETURNING locking case to the DB.selectValue(s)/selectArray/selectObject() family of functions. Add tests for INSERT/UPDATE...RETURNING with those functions.
stephan [Fri, 19 May 2023 17:50:16 +0000 (17:50 +0000)]
oo1.Stmt.finalize() no longer throws, but instead returns the same as the C API. oo1.DB.exec() now triggers the INSERT...RETURNING locking failure as an exception via reset() instead of finalize(). Some code-adjacent internal API renaming for clarity's sake.
stephan [Fri, 19 May 2023 15:54:41 +0000 (15:54 +0000)]
sqlite3.oo1.Stmt.finalize() now throws if sqlite3_finalize() returns non-zero. This is intended to address the INSERT RETURNING case covered in [forum:36f7a2e7494897df|forum post 36f7a2e7494897df].
drh [Fri, 19 May 2023 11:48:05 +0000 (11:48 +0000)]
Change the RTREE engine so that equality comparisons of floating point
values are duplicated in the byte-code so that the comparisons are done
using 64-bit floats and consistent results are always obtained.
[forum:/forumpost/da61c4a1b5b4af19|Forum post da61c4a1b5b4af19].
dan [Wed, 17 May 2023 11:31:51 +0000 (11:31 +0000)]
Avoid an assert() failure that could occur in SQLITE_ENABLE_UPDATE_DELETE_LIMIT builds when a WITH clause attached to an UPDATE or DELETE statement created a CTE of the same name as the table being modified.
drh [Mon, 15 May 2023 02:06:35 +0000 (02:06 +0000)]
As evidenced by [forum:/forumpost/f3f546025a|forum post f3f546025a], the
new RIGHT JOIN related restriction on the push-down optimization implemented
by [da3fba18742b6e0b] also needs to apply to the automatic index
(a.k.a. hash-join) optimization and to the Bloom filter optimization.
Computation of the restriction is now
moved into the sqlite3ExprIsSingleTableConstraint() routine.
dan [Sat, 13 May 2023 19:13:40 +0000 (19:13 +0000)]
Add an "#ifndef SQLITE_HAVE_SQLITE3R" directive to shell.c.in, to avoid including the recovery code a second time if the shell is being compiled with sqlite3r.c.
drh [Fri, 12 May 2023 15:45:34 +0000 (15:45 +0000)]
Make the regexp extension more robust against OOM errors during compilation
of the recognizer engine.
[forum:/forumpost/f50aecd5e8|Forum post f50aecd5e8].
drh [Fri, 12 May 2023 10:52:12 +0000 (10:52 +0000)]
Ensure that all prepared statements are expired and forced to reprepare
whenever the database text encoding changes.
[forum:/forumpost/43cbfc4d23|Forum post 43cbfc4d23].
drh [Thu, 11 May 2023 21:15:55 +0000 (21:15 +0000)]
Add [/info/cec6a06508239c09e363?ln=5525-5531|restriction (5)] to the
omit-noop-join optimization. Fix for the issue reported by
[forum/forumpost/49f2c7f690|forum post 49f2c7f690].
drh [Wed, 10 May 2023 16:04:04 +0000 (16:04 +0000)]
Enhance the split-sqlite3c.tcl script so that it uses single-character
extensions on subordinate source files, even when the number of subordinates
exceeds 9. This is not yet needed, but might be soon.
drh [Wed, 10 May 2023 11:05:59 +0000 (11:05 +0000)]
Rename sqlite3IsTableConstraint() to sqlite3IsSingleTableConstraint() and
improve its header comment, in an attempt to make the code easier to reason
about. No functional changes - should generate identical machine code.
drh [Wed, 10 May 2023 00:33:21 +0000 (00:33 +0000)]
New restriction on the push-down optimization to prevent an ON or USING clause
on the left side of a RIGHT JOIN from being pushed down into a subquery that
is on the right side of that RIGHT JOIN.
[forum:/forumpost/a7d4be7fb6|Forum post a7d4be7fb6].
Also add comments to describe previously undocumented push-down optimization
restrictions.
drh [Mon, 8 May 2023 13:38:14 +0000 (13:38 +0000)]
In editPage(), if an attempt is made to edit an empty 64KB page, then take
the slow path through rebuildPage(), in order to maintain strict invariants
in the editPage() code.
[forum:/forumpost/0f37727c0d|Forum post 0f37727c0d].
drh [Mon, 8 May 2023 11:11:08 +0000 (11:11 +0000)]
Ensure that the label for a JSON object really is a string and not an array
or object that just happens to end with a string.
dbsqfuzz 32f62ed8676d0a153dbe756aeae3202d3670fe50.
drh [Sun, 7 May 2023 03:23:32 +0000 (03:23 +0000)]
It turns out that pagerExclusiveLock() can be called with the lock state
already set to RESERVED if the SQLITE_FCNTL_PERSIST_WAL setting is set and
a specific sequence of multiple journal mode changes occur.
Enhance pagerExclusiveLock() to deal with this.
[forum:/forumpost/8130545bc6|Forum post 8130545bc6]