drh [Wed, 14 Jun 2023 13:45:41 +0000 (13:45 +0000)]
Add SQLITE_DBCONFIG_RANDOM_SCANORDER. This option causes unconstrained table
and index scan to happen in a random order, in order to help detect
under-constrained queries in applications.
drh [Tue, 13 Jun 2023 16:55:24 +0000 (16:55 +0000)]
Extended the time-diff format so that it can have a 5-digit year. This enables
time differences to span the full range of dates supported by SQLite. Also
fix some inaccuracies in the computation of time differences and add new
test cases.
dan [Mon, 12 Jun 2023 13:49:37 +0000 (13:49 +0000)]
Fix a problem causing bloom filters to be used less efficiently than they might be. Problem reported by forum post [forum:/info/06c3f01da6 | 06c3f01da6].
drh [Sun, 11 Jun 2023 21:58:20 +0000 (21:58 +0000)]
Make sure temporary sqlite3_value objects used by STAT4 are reset to NULL prior
to being reused, to prevent a memory leak associated with
the custom xDel string value destructor.
dbsqlfuzz 65209ab5d5730e4fd14fff9d024325a77239036e.
drh [Sat, 10 Jun 2023 10:37:49 +0000 (10:37 +0000)]
Enhance fuzzcheck so that it understand the sqlite3_db_config() and
optimization settings from unused bits in the database header, which
dbsqlfuzz is now using.
drh [Fri, 9 Jun 2023 15:54:18 +0000 (15:54 +0000)]
Simplify a memcpy() in defragmentPage(). It now might copy more content than
is strictly necessary, but runs faster and uses less code space. Possible
reasons for the improved performance:
(1) the copy is now always 8-byte aligned,
(2) fewer intermediate results are required which means less register
pressure which helps the compiler to optimize the subroutine.
drh [Thu, 8 Jun 2023 16:19:21 +0000 (16:19 +0000)]
Improvements to the src-verify.c utility program so that it continues to
muddle through a corrupt manifest file, making the most sense of it that it
can and reporting "manifest" has having changed at the end.
drh [Thu, 8 Jun 2023 12:52:28 +0000 (12:52 +0000)]
Enhance Lemon so that it remembers which -D command-line options are actually
used in the grammar and includes a list of all such options in the header
of the generated output file.
larrybr [Wed, 7 Jun 2023 23:10:40 +0000 (23:10 +0000)]
Add spell-checking for all comments in main sources. (./src/ .c .h .in) make target "misspell" tells of misspelled words for which no exceptions have been put into tool/custom.txt .
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.