drh [Mon, 20 Mar 2023 15:50:40 +0000 (15:50 +0000)]
Fix a problem causing a cursor to retain an out-of-date cell-info cache when processing a DISTINCT query on values that are identical according to their collation sequence, but different on disk.
drh [Fri, 17 Mar 2023 12:25:10 +0000 (12:25 +0000)]
Ensure that an error does not delete the Table object out from under
the xConstruct method of a virtual table.
dbsqlfuzz 7cc8804a1c6d4e3d554d79096e6ea75a7c1c7d2d
drh [Thu, 16 Mar 2023 10:21:52 +0000 (10:21 +0000)]
Do not use the one-pass optimization on an UPDATE if there is a subquery
in the WHERE clause, since if the subquery is hidden behind a short-circuit
operator, the subquery might not be evaluated until after one or more rows
have been updated.
drh [Thu, 9 Mar 2023 16:04:34 +0000 (16:04 +0000)]
In the Bloom filter optimization, hash all strings and blobs into the same
value, because we do not know if two different strings might compare equal
even if they have different byte sequences, due to collating functions.
Formerly, the hash of a string or blob was just its length. This could
all be improved.
drh [Wed, 8 Mar 2023 14:37:04 +0000 (14:37 +0000)]
Keep the historical datatype ("INT", not "NUM") for a table created as follows: "CREATE TABLE t1 AS SELECT CAST(123 AS INT) AS value;". The use of FLEXNUM only occurs on compound queries.
drh [Fri, 3 Mar 2023 18:47:29 +0000 (18:47 +0000)]
Enhance PRAGMA integrity_check so that it can detect when there are extra
bytes at the end of an index record, which might cause OP_IdxRowid to
malfunction.
drh [Fri, 3 Mar 2023 17:11:15 +0000 (17:11 +0000)]
When it is known when preparing a statement that X cannot be NULL, transform the expression (X IS NULL) to integer value 1 instead of 'true'. This is because under some circumstances, "Y IS TRUE" may not be equivalent to "Y IS 1".
drh [Thu, 2 Mar 2023 14:09:11 +0000 (14:09 +0000)]
When flattening the right operand of a LEFT JOIN,
ensure that the OP_IfNullRow opcode does not
NULL-out a subquery result that was computed within OP_Once.
drh [Wed, 1 Mar 2023 20:44:34 +0000 (20:44 +0000)]
When flattening a view that is the right operand of a LEFT JOIN
always insert the TK_IF_NULL_ROW expression nodes, even for TK_COLUMN
expressions, as the TK_COLUMN might be a column from an outer query
and hence still need to be NULLed out.
drh [Wed, 1 Mar 2023 15:28:34 +0000 (15:28 +0000)]
Make sure subtypes do not cross a subquery
boundary even if the function that returned the value with a subtype is
buried down inside a larger expression.
drh [Sun, 26 Feb 2023 21:09:45 +0000 (21:09 +0000)]
When a table-valued function appears as the right table of a RIGHT JOIN,
the argument constraints on the table-valued function should be considered
part of the ON clause of the RIGHT JOIN.
drh [Thu, 23 Feb 2023 17:12:07 +0000 (17:12 +0000)]
Provide -DHAVE_LOG2=0 and -DHAVE_LOG10=0 compile-time options for use on systems
that lack the log2() and log10() standard math library routines, to cause
SQLite to substitute its own alternatives.
drh [Tue, 21 Feb 2023 12:30:18 +0000 (12:30 +0000)]
Fix formatting and improved documentation on the various sqlite3_file_control()
opcodes. Other minor documentation changes. No changes to working code.
drh [Mon, 13 Feb 2023 12:46:22 +0000 (12:46 +0000)]
In the LIKE optimization, do not analyze the new virtual WHERE clause terms
until both have been added, since they are expected to be consecutive and
the analysis might add complementary terms.
This fixes a problem caused by [44200596aa943963] and discovered by dbsqlfuzz
and recorded as case 7e3b5983727d843b910b2d9ab556e4afcd777cfb.
drh [Fri, 10 Feb 2023 21:53:33 +0000 (21:53 +0000)]
Do a better job of detecting when a WHERE clause term might be useful to
an expression index. Fix for performance regression reported by
[forum:/forumpost/e65800d8cb|forum thread e65800d8cb].
dan [Fri, 10 Feb 2023 17:17:04 +0000 (17:17 +0000)]
Fix a problem with the fts5 trigram tokenizer and LIKE or GLOB patterns for which contain runs of 2 or fewer non-wildcard characters that are 3 or more bytes when encoded as utf-8.
drh [Thu, 9 Feb 2023 15:32:24 +0000 (15:32 +0000)]
Disable the double-quoted string misfeature by default in CLI builds.
DQS can be reenabled at run-time using the ".dbconfig dqs_dml" and
".dbconfig dqs_ddl" dot-commands.
drh [Wed, 8 Feb 2023 20:29:48 +0000 (20:29 +0000)]
Back out the 'txn' enhancement to date/time functions. The duration of a
"transaction" is confused and needs to be straightened out prior to moving
forward with this change.
drh [Wed, 8 Feb 2023 12:01:48 +0000 (12:01 +0000)]
Revert the behavior of date/time functions with no arguments so that they
once again work like 'now', even while CURRENT_TIMESTAMP and similar work
like 'txn'.
drh [Wed, 8 Feb 2023 11:34:05 +0000 (11:34 +0000)]
Change the behavior of date-time functions without any arguments (and thus
the CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP variables) so that they
work like 'txn' instead of like 'now'. This is an incompatibility with legacy,
but brings SQLite into conformance with all other SQL systems.
drh [Sun, 5 Feb 2023 20:29:10 +0000 (20:29 +0000)]
Do not use a Bloom filter if any outer loop lacks STAT1 data, since without
STAT1 data, the query planner cannot make an accurate determination of
whether or not a Bloom filter will be useful. This fixes the problem
reported by [forum:/forumpost/56de336385|forum post 56de336385].
drh [Sun, 5 Feb 2023 00:47:27 +0000 (00:47 +0000)]
Restore a test for pBt NULL that was removed by [12a14711afa6cddb] but turned
out to be necessary, as dbsqlfuzz quickly showed us. Test case added to TH3.