Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

planner: remove the limitation that predicates can't be pushed through Projection on TableDual (#51329) #52165

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
resolve conflicts
  • Loading branch information
time-and-fate committed Mar 27, 2024
commit 8c89e94c75e6c1fd79aaedef2ab8b0c0150c37c3
9 changes: 0 additions & 9 deletions pkg/planner/core/rule_predicate_push_down.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,15 +521,6 @@ func (p *LogicalProjection) PredicatePushDown(predicates []expression.Expression
return predicates, child
}
}
<<<<<<< HEAD
if len(p.children) == 1 {
if _, isDual := p.children[0].(*LogicalTableDual); isDual {
return predicates, p
}
}
=======
exprCtx := p.SCtx().GetExprCtx()
>>>>>>> 27ce02afd2e (planner: remove the limitation that predicates can't be pushed through `Projection` on `TableDual` (#51329))
for _, cond := range predicates {
substituted, hasFailed, newFilter := expression.ColumnSubstituteImpl(cond, p.Schema(), p.Exprs, true)
if substituted && !hasFailed && !expression.HasGetSetVarFunc(newFilter) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,14 +568,10 @@ select
)
order by c0 desc limit 1) as c1
from
<<<<<<< HEAD
(select 1 as c0) as subq_1;
=======
(select 1 as c0) as subq_1;

# TestIssue50614
use test;
drop table if exists tt;
create table tt(a bigint, b bigint, c bigint, d bigint, e bigint, primary key(c,d));
explain format = brief update tt, (select 1 as c1 ,2 as c2 ,3 as c3, 4 as c4 union all select 2,3,4,5 union all select 3,4,5,6) tmp set tt.a=tmp.c1, tt.b=tmp.c2 where tt.c=tmp.c3 and tt.d=tmp.c4 and (tt.c,tt.d) in ((11,111),(22,222),(33,333),(44,444));
>>>>>>> 27ce02afd2e (planner: remove the limitation that predicates can't be pushed through `Projection` on `TableDual` (#51329))