Commit Graph

13 Commits

Author SHA1 Message Date
dan
7ac0e562a3 Fix an assert() failure that could occur in a join query if the RHS of an IN() operator is a list containing correlated expressions. This problem was introduced by checkin [e130319317e7611938] which was part of the fix for ticket [787fa716be3a7f650c] - so this commit is part of that ticket's fix too.
FossilOrigin-Name: 778b1224a318d0137c7dab8361128f593506d3677267898119b934b4d66dfe38
2019-05-18 21:22:25 +00:00
drh
8851e10017 Do not do the optimization that attempts to pull expression values from
an index on that expression when processing a multi-index OR
(see check-in [a47efb7c8520a0111]) because the expression transformations
that are applied become invalid when the processing moves off of the current
index and on to the next index.  Fix for ticket [4e8e4857d32d401f].

FossilOrigin-Name: 440a7cda000164d3b46109caf2e1dde80681ba9b0d94ba9be6847d2b917445cf
2019-02-08 04:15:19 +00:00
drh
bd462bcc10 Improvements to EXPLAIN QUERY PLAN formatting. The MULTI-INDEX OR now shows
a separate "INDEX" subtree for each index.  SCALAR SUBQUERY entries provide
a subquery number that is related back to the .selecttrace output.

FossilOrigin-Name: 7153552bac51295c56a1c42ca79d57195851e232509f9e9610375692f48c7e86
2018-12-24 20:21:06 +00:00
drh
5d72d9245d Make a separate limb in the EXPLAIN QUERY PLAN output for the various lines
associated with the OR-optimization.

FossilOrigin-Name: 75ac7b4e4fd0811ca80c719badacff207e0bbd00ac64dde3b3d4ec676fad472d
2018-05-04 00:39:43 +00:00
drh
b3f0276b9e Fix test cases so that they work with the new EXPLAIN QUERY PLAN output
format.  Only some of the cases have been fixed.  This is an incremental
check-in.

FossilOrigin-Name: 5f0e803e33aa557865d5fc830d9202d628de9a94c9757058ca48f1a560702cd3
2018-05-02 18:00:17 +00:00
dan
820fcd2ce9 Fix a problem with processing "LEFT JOIN tbl ON tbl.a = ? AND (tbl.b=? OR
tbl.c=?)" in cases where there are indexes on both tbl(a, b) and tbl(a, c).

FossilOrigin-Name: ce35e39c5cc2b00dd6b4a9ffaa9d5eb7d9b862759e87d5f053729de7643eee9c
2018-04-24 18:53:24 +00:00
dan
4da04f784f Do not attempt to read values from indexes-on-expressions if the index is on
the RHS of a LEFT JOIN. This won't work if the index cursor points at a
null-row. Fix for [7fa80496].

FossilOrigin-Name: b8ef967ab1bebf2846c06c4f7200d6fa1c60e52e55711ea171c25ef1331f8a24
2018-04-24 14:05:14 +00:00
drh
f6e6f02308 Fix incorrect testcase labels on two cases in join5.test. No changes to code.
FossilOrigin-Name: 4661ac81c9589b06a07df8b7931fbd0a7f9a4e9ba1448192b70701dc85a29bd2
2018-03-20 19:02:03 +00:00
dan
92ddb3bd02 Avoid clearing the EP_FromJoin flag from terms in ON clauses when flattening
sub-selects. Possible fix for [2df0107b].

FossilOrigin-Name: 8bed4cd549759a93c4a087d8d8c08c0068ba8d59
2016-12-01 19:38:05 +00:00
drh
38978dd4ed Do not apply the WHERE-clause pushdown optimization to terms that originate
in the ON or USING clause of a LEFT JOIN.  Fix for ticket
[6df18e949d3676290].

FossilOrigin-Name: 351bc22fa9b5a2e50da3583a882c5aa390bda19f
2015-08-22 01:32:29 +00:00
drh
72673a24e2 If a table is the right operand of a LEFT JOIN, then any column of that
table can be NULL even if that column as a NOT NULL constraint.
Fix for ticket [6f2222d550f5b0ee7ed].

FossilOrigin-Name: 6f6fcbe4736b9468a495c684d5eebc8bfe5c566a
2014-12-04 16:27:17 +00:00
drh
0a168377ad Fix the query optimizer so that it correctly handles constant expressions
in the ON clause of a LEFT JOIN.  Ticket #2403. (CVS 4049)

FossilOrigin-Name: 46fdd195483787eef209a9b8ad108eba147be6fa
2007-06-08 00:20:47 +00:00
drh
22d6a53a77 ON-clause terms in a LEFT JOIN that restrict only the left table, should not
really restrict the left table but instead rows that fail to meet the condition
to be joined with NULL rows from the right table. (CVS 2725)

FossilOrigin-Name: ea10f9785e3c5248dafcc297f3a2c5465b6e0dba
2005-09-19 21:05:48 +00:00