drh [Mon, 24 Feb 2020 16:46:08 +0000 (16:46 +0000)]
Rework this changes so that instead of setting the WhereTerm.truthProb when
a term is seen to be of low selectivity, it merely sets a new flag
(the TERM_HIGHTRUTH flag) which causes whereLoopOutputAdjust() to ignore
that term.
drh [Sat, 22 Feb 2020 18:27:48 +0000 (18:27 +0000)]
Do not activate the truthProb adjustment mechanism if the truth probability
is less than the heuristic value, as there could be correlations unknown to
stat4. Also add additional tracing output to make truthProb adjustments more
visible.
drh [Sat, 22 Feb 2020 13:01:19 +0000 (13:01 +0000)]
In the OP_Column opcode, if the cursor is marked NullRow (due to being the
right table of a LEFT JOIN that does not match) and the cursor is the table
cursor for an OR-optimization with a covering index, then do not substitute
the covering index cursor, since the covering index cursor does not have
the NullRow flag set. Ticket [aa4378693018aa99]
drh [Mon, 17 Feb 2020 00:12:04 +0000 (00:12 +0000)]
Take care when checking the table of a TK_COLUMN expression node to see if the
table is a virtual table to first ensure that the Expr.y.pTab pointer is not
null due to generated column optimizations. Ticket [4374860b29383380].
dan [Wed, 12 Feb 2020 11:57:35 +0000 (11:57 +0000)]
When determining whether an == or IS constraint in a WHERE clause makes an ORDER BY term redundant, consider the collation sequence used by the == or IS comparison, not the collation sequence of the comparison expression itself. Possible fix for [fb8c538a8f].
drh [Wed, 5 Feb 2020 18:28:17 +0000 (18:28 +0000)]
Small size reduction and performance improvement in the
sqlite3VdbeMemFromBtree() interface used to pull content out of the b-tree
and into an sqlite3_value object.
drh [Tue, 4 Feb 2020 01:41:44 +0000 (01:41 +0000)]
Extend the OP_Copy-coalesce optimization fix of check-in [b36126c1889e323c]
so that it is also correctly disabled by the CASE operator.
Ticket [9d3666754ac37d5a].
drh [Mon, 3 Feb 2020 19:56:51 +0000 (19:56 +0000)]
Cosmetic change to the xfer-optimization to put the OP_RowData opcode closer
to the corresponding OP_Insert opcode. This makes it slightly easier to read
and understand the code.
drh [Sat, 1 Feb 2020 17:38:24 +0000 (17:38 +0000)]
Fix the comment display for the OP_Function opcode. And at the same time,
improve the comment generating logic to make use of the newer
sqlite3_str_appendf() interface.
dan [Wed, 29 Jan 2020 15:03:01 +0000 (15:03 +0000)]
Fix a problem with the processing of IN(...) constraints handled by virtual table implementations that do not set the "omit" flag when the virtual table column contains at least one NULL value.
drh [Tue, 28 Jan 2020 18:09:53 +0000 (18:09 +0000)]
Reinstate the optimization of converting "a IN (C)" into "a=C" but only
if C is a constant. If the RHS is a table column, the complications of
managing affinity and collations become too involved to mess with.
drh [Mon, 27 Jan 2020 14:40:44 +0000 (14:40 +0000)]
Revise the layout of filenames in the Pager object so that it is unchanged
from prior versions. It turns out that some important 3rd-party software
does questionable pointer manipulations on those filenames that depend on
that legacy layout. Technical this is a misuse of SQLite by the 3rd-party
software, but we want to avoid unnecessary breakage.
drh [Tue, 21 Jan 2020 12:29:02 +0000 (12:29 +0000)]
Fix the series.c and spellfix.c extensions to use SQLITE_VTAB_INNOCUOUS
correctly. Fix the documentation on sqlite3_vtab_config() to take into
account SQLITE_VTAB_INNOCUOUS and SQLITE_VTAB_DIRECTONLY.
drh [Mon, 20 Jan 2020 14:42:09 +0000 (14:42 +0000)]
In the fuzzcheck test program, reduce the default expression depth limit
from 1000 to 500 to avoid stack-overflow problems when running stress tests
using clang ASAN.
drh [Sat, 18 Jan 2020 21:34:31 +0000 (21:34 +0000)]
Allow non-deterministic function in CHECK constraints. It turns out that
PostgreSQL, MySQL, and SQLServer all allow this. We should be the the
exception. Ticket [830277d9db6c3ba1]
drh [Sat, 18 Jan 2020 13:53:46 +0000 (13:53 +0000)]
Fix the VDBE so that it correctly handles the sequence of operations
OP_OpenEphemeral, OP_OpenDup, OP_OpenEphemeral, and OP_OpenDup in that
order on the same cursor.
drh [Fri, 17 Jan 2020 21:12:22 +0000 (21:12 +0000)]
The compress() function should not be deterministic since the same input can
have multiple possible compressed outputs. The uncompress() function, on the
other hand, is deterministic.
dan [Fri, 17 Jan 2020 15:45:59 +0000 (15:45 +0000)]
Update test script instrfault.test to account for the fact that bound blob values cast to text values are now intepreted using the text encoding of the database, instead of always as utf-8.
drh [Wed, 15 Jan 2020 16:20:16 +0000 (16:20 +0000)]
Do not allow the "PRAGMA encoding" statement to change the database
encoding if TEMP content exists, or content in any other attached
database. Formerly, encoding changes were allowed if just the main
database file was empty. Ticket [a08879a4a476eea9].
drh [Tue, 14 Jan 2020 16:50:09 +0000 (16:50 +0000)]
Fix the urifuncs.c extension (used for testing and debugging only) so that
the sqlite3_filename_database() SQL function and its siblings correctly handle
an invalid schema name passed in as the argument.
drh [Sun, 12 Jan 2020 22:38:17 +0000 (22:38 +0000)]
Better than removing the incorrect assert() is to change it into a
testcase() together with a comment indicating where an appropriate test case
can be found, and the ticket that provoked the change.
Ticket [614b25314c766238]
drh [Sun, 12 Jan 2020 22:25:58 +0000 (22:25 +0000)]
Change the zipfile virtual table so that the xBestIndex method gives a
reasonable cost estimate even if no filename is specified. The missing
filename error continues to be raised in the xFilter method. Meanwhile,
the more reasonable cost estimate avoids unnecessary wierdness in the query
planner.