Skip to content

Commit

Permalink
This is an automated cherry-pick of pingcap#53097
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <[email protected]>
  • Loading branch information
yibin87 authored and ti-chi-bot committed May 10, 2024
1 parent f925e71 commit f06fd11
Show file tree
Hide file tree
Showing 3 changed files with 720 additions and 0 deletions.
27 changes: 27 additions & 0 deletions executor/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -2895,13 +2895,40 @@ func constructDAGReq(ctx sessionctx.Context, plans []plannercore.PhysicalPlan, s

func (b *executorBuilder) corColInDistPlan(plans []plannercore.PhysicalPlan) bool {
for _, p := range plans {
<<<<<<< HEAD:executor/builder.go
x, ok := p.(*plannercore.PhysicalSelection)
if !ok {
continue
}
for _, cond := range x.Conditions {
if len(expression.ExtractCorColumns(cond)) > 0 {
return true
=======
switch x := p.(type) {
case *plannercore.PhysicalSelection:
for _, cond := range x.Conditions {
if len(expression.ExtractCorColumns(cond)) > 0 {
return true
}
}
case *plannercore.PhysicalProjection:
for _, expr := range x.Exprs {
if len(expression.ExtractCorColumns(expr)) > 0 {
return true
}
}
case *plannercore.PhysicalTopN:
for _, byItem := range x.ByItems {
if len(expression.ExtractCorColumns(byItem.Expr)) > 0 {
return true
}
}
case *plannercore.PhysicalTableScan:
for _, cond := range x.LateMaterializationFilterCondition {
if len(expression.ExtractCorColumns(cond)) > 0 {
return true
}
>>>>>>> 203e5f2cff1 (executor: Fix push downed topN won't replace correlated column problem (#53097)):pkg/executor/builder.go
}
}
}
Expand Down
30 changes: 30 additions & 0 deletions pkg/executor/test/issuetest/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
load("@io_bazel_rules_go//go:def.bzl", "go_test")

go_test(
name = "issuetest_test",
timeout = "short",
srcs = [
"executor_issue_test.go",
"main_test.go",
],
flaky = True,
shard_count = 19,
deps = [
"//pkg/autoid_service",
"//pkg/config",
"//pkg/kv",
"//pkg/meta/autoid",
"//pkg/parser/auth",
"//pkg/parser/charset",
"//pkg/parser/mysql",
"//pkg/session/types",
"//pkg/testkit",
"//pkg/util",
"//pkg/util/dbterror/exeerrors",
"//pkg/util/memory",
"@com_github_pingcap_failpoint//:failpoint",
"@com_github_stretchr_testify//require",
"@com_github_tikv_client_go_v2//tikv",
"@org_uber_go_goleak//:goleak",
],
)
Loading

0 comments on commit f06fd11

Please sign in to comment.