drh [Fri, 21 Jan 2022 16:47:41 +0000 (16:47 +0000)]
When computing a vector to be used as a key for an index lookup, do not
check for NULL values and abort until after all key values have been
computed, in case one of the later key values involves some initialization
that is needed by a LEFT JOIN. Fix for the problem identified by
[forum:/forumpost/ab95010d410a0a55|Forum post ab95010d410a0a55].
drh [Thu, 20 Jan 2022 12:36:00 +0000 (12:36 +0000)]
Fix the ability to read read-only WAL-mode database when -shm is present,
([00ec95fcd02bb415|check-in 00ec95fcd02bb415]) so that it works
for the case of 64K page size.
drh [Mon, 17 Jan 2022 23:53:22 +0000 (23:53 +0000)]
Allow an "IntReal" value to count as a REAL when checking types for
insertion into a generated column on a STRICT table.
[forum:/forumpost/fa012c77796d9399|Forum post fa012c77796d9399].
drh [Sun, 2 Jan 2022 19:43:58 +0000 (19:43 +0000)]
Do not open a rollback journal file when the journal_mode is OFF, even if
such a file exists on disk. See
[forum/forumpost/ec2a102440|forum post ec2a102440] for a description. I so
far have been unable to find any harm to come of the problem, other than the
assertion fault when in DEBUG mode.
drh [Sun, 2 Jan 2022 18:10:48 +0000 (18:10 +0000)]
Clear the cache of triggers used to implement CASCADE foreign key constraints
whenever the schema changes. Fix for the problem identified by
[forum:/forumpost/2831335356|forum post 2831335356].
drh [Sun, 2 Jan 2022 17:37:56 +0000 (17:37 +0000)]
Do not raise an SQLITE_SCHEMA error if in sqlite3Init(). Fix for PoC #2 in
[forum:/forumpost/b03d86f951|forum post b03d86f951]. See TH3 for test
cases.
drh [Sun, 2 Jan 2022 17:14:39 +0000 (17:14 +0000)]
Remove an obsolete assert() statement that no longer does anything useful
and which is not always true. Fix for PoC #1 of
[forum:/forumpost/b03d86f951|forum post b03d86f951].
drh [Sun, 2 Jan 2022 17:13:36 +0000 (17:13 +0000)]
Fix a faulty assert() statement - adding a CORRUPT_DB term - based on a test
case derived from [562805cf488a455c]. Also add a test case to that prior
issue.
drh [Sun, 2 Jan 2022 17:00:19 +0000 (17:00 +0000)]
Move the pTriggerPrg and pCleanup elements of the Parse object up into the
section of that object that is persisted across calls to sqlite3NestedParse().
This fixes a memory leak
[forum:/info/24bd1fef7e9323ef|reported in forum post 24bd1fef7e9323ef].
drh [Thu, 30 Dec 2021 11:35:38 +0000 (11:35 +0000)]
Fix windowC tests to specify little-endian or big-endian UTF16, for cross-platform portability. [forum post 559b84a5c6|forum:/forumpost/559b84a5c6]. And
give the correct prefix to tests in the windowC.test module.
drh [Thu, 30 Dec 2021 11:27:53 +0000 (11:27 +0000)]
Do not attempt to reprepare a prepared statement that returns SQLITE_SCHEMA
if there was an OOM. This enhancement supercedes check-in
[fee469925231d074].
drh [Thu, 30 Dec 2021 03:12:37 +0000 (03:12 +0000)]
When a table has an INTEGER PRIMARY KEY ON CONFLICT REPLACE and some other
uniqueness constraint, and it participates in an upsert on that other
constraint, ensure that code that checks for conflicts on the INTEGER PRIMARY
KEY is well-formed. Fix for the problem reported by
[forum:/forumpost/06b16b8b29f8c8c3|forum post 06b16b8b29f8c8c3].
drh [Mon, 6 Dec 2021 16:56:06 +0000 (16:56 +0000)]
Do not allow SQLITE_LIMIT_LENGTH to be set lower than 1 as an
SQLITE_LIMIT_LENGTH of 0 causes lots of unnecessary problems for
users of the sqlite3_str object.
drh [Fri, 26 Nov 2021 17:10:18 +0000 (17:10 +0000)]
Improved defenses against integer overflow when computing the size of a
memory allocations. No bugs were fixed here. But perhaps future bugs will
be prevented.
drh [Mon, 15 Nov 2021 19:10:13 +0000 (19:10 +0000)]
Strengthen the sticky-CORRUPT idea of check-in [3feb0f1c3840904d] by
automatically changing the first COMMIT after an SQLITE_CORRUPT error into
a ROLLBACK.
dan [Mon, 15 Nov 2021 14:11:23 +0000 (14:11 +0000)]
Fix a problem causing the count(*) optimization to be misapplied in some cases where an aggregate sub-query uses a count() expression that is aggregated against the outer query.
drh [Wed, 10 Nov 2021 10:59:10 +0000 (10:59 +0000)]
Make SQLITE_CORRUPT sticky: If a CORRUPT error is returned, all subsequent
write statements within the same transaction also fail early with
SQLITE_CORRUPT.
drh [Mon, 8 Nov 2021 23:24:00 +0000 (23:24 +0000)]
Refactor the code that figures out which SELECT in a cascade of nested queries
a particular aggregate function belongs to. This fixes the problem
reported by [forum:/forumpost/c7cc2aa3546e39c1|forum post c7cc2aa3546e39c1].
New test cases in dbsqlfuzz and th3.
drh [Sun, 7 Nov 2021 23:33:01 +0000 (23:33 +0000)]
Ensure that the window function rewrite does not leave the parse tree
in an invalid state that might cause problems downstream before the
error is recognized and unwinds the stack. Also take steps such that
an invalid parse tree does not cause problems even if it goes
unrecognized.
[forum:/forumpost/398e9d5aa9|Forum post 398e9d5aa9].
dan [Fri, 5 Nov 2021 19:04:01 +0000 (19:04 +0000)]
If the target database URI passed to sqlite3rbu_open() is contains the option "rbu_exclusive_checkpoint=1", hold an exclusive lock for the duration of any incremental checkpoint operation.
drh [Fri, 5 Nov 2021 11:52:33 +0000 (11:52 +0000)]
Remove an incorrect NEVER() reported at
[forum:/forumpost/5bbabfb7ce|forum post 5bbabfb7ce]. Also use this
opportunity to improve the isSimpleCount() function with better formatting,
an expanded header comment, and some extra assert() and textcase() macros.
dan [Thu, 4 Nov 2021 16:15:46 +0000 (16:15 +0000)]
Update a test case in corruptN.test to account for the fact that if writable_schema=1 is set, no error is raised if a DELETE statement finds that an index entry is missing ([19e56291a7344c7a]).
drh [Thu, 4 Nov 2021 00:51:53 +0000 (00:51 +0000)]
First the shadow table mechanism so that it works even if the shadow table
comes before the virtual table in the sqlite_schema table, as can happen
after a VACUUM.