Skip to content

Fix incorrect pushdown of expression below join#13110

Closed
martint wants to merge 1 commit intotrinodb:masterfrom
martint:join-pushdown-bug
Closed

Fix incorrect pushdown of expression below join#13110
martint wants to merge 1 commit intotrinodb:masterfrom
martint:join-pushdown-bug

Conversation

@martint
Copy link
Copy Markdown
Member

@martint martint commented Jul 7, 2022

PushInequalityFilterExpressionBelowJoin was incorrectly
pushing a projection into the inner side of an outer join.
This is an invalid transformation when the outer join produces
a null for the columns of the inner table in case of a mismatch
and the expression that's pushed down does not preserve nulls.

As a temporary fix, limit the scope of the rule only to inner joins.

Fixes #13109

Documentation

(x) No documentation is needed.

Release notes

(x) Release notes entries required with the following suggested text:

# General
* Fix incorrect results for queries involving certain non-equality filters on top of an outer join. ({issue}`13109`)

PushInequalityFilterExpressionBelowJoin was incorrectly
pushing a projection into the inner side of an outer join.
This is an invalid transformation when the outer join produces
a null for the columns of the inner table in case of a mismatch
and the expression that's pushed down does not preserve nulls.

As a temporary fix, limit the scope of the rule only to inner joins.
@cla-bot cla-bot bot added the cla-signed label Jul 7, 2022
@martint martint requested review from kasiafi and sopel39 July 7, 2022 00:37
@martint
Copy link
Copy Markdown
Member Author

martint commented Jul 7, 2022

cc @lukasz-stec

@sopel39
Copy link
Copy Markdown
Member

sopel39 commented Jul 7, 2022

More targeted fix for #13114. It will still pushdown predicates within outer join so that outer join can take advantage of faster ineq join execution (sorted position links)

@martint
Copy link
Copy Markdown
Member Author

martint commented Jul 7, 2022

Superseded by #13114

@martint martint closed this Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Incorrect LEFT JOIN behavior when combined with WHERE starting in v380

2 participants