Skip to content

Commit

Permalink
This is an automated cherry-pick of pingcap#50932
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
  • Loading branch information
qw4990 authored and ti-chi-bot committed Feb 19, 2024
1 parent f4dabb9 commit ce91b6d
Show file tree
Hide file tree
Showing 4 changed files with 455 additions and 3 deletions.
6 changes: 6 additions & 0 deletions expression/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,14 @@ func SetExprColumnInOperand(expr Expression) Expression {

// ColumnSubstitute substitutes the columns in filter to expressions in select fields.
// e.g. select * from (select b as a from t) k where a < 10 => select * from (select b as a from t where b < 10) k.
<<<<<<< HEAD:expression/util.go
func ColumnSubstitute(expr Expression, schema *Schema, newExprs []Expression) Expression {
_, _, resExpr := ColumnSubstituteImpl(expr, schema, newExprs, false)
=======
// TODO: remove this function and only use ColumnSubstituteImpl since this function swallows the error, which seems unsafe.
func ColumnSubstitute(ctx sessionctx.Context, expr Expression, schema *Schema, newExprs []Expression) Expression {
_, _, resExpr := ColumnSubstituteImpl(ctx, expr, schema, newExprs, false)
>>>>>>> a0296bebe39 (planner: stop pushing Agg down through Projection if substitution fail (#50932)):pkg/expression/util.go
return resExpr
}

Expand Down
32 changes: 32 additions & 0 deletions pkg/planner/core/casetest/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
load("@io_bazel_rules_go//go:def.bzl", "go_test")

go_test(
name = "casetest_test",
timeout = "moderate",
srcs = [
"integration_test.go",
"main_test.go",
"plan_test.go",
"stats_test.go",
"tiflash_selection_late_materialization_test.go",
],
data = glob(["testdata/**"]),
flaky = True,
shard_count = 19,
deps = [
"//pkg/domain",
"//pkg/parser",
"//pkg/parser/model",
"//pkg/planner/core",
"//pkg/planner/property",
"//pkg/testkit",
"//pkg/testkit/testdata",
"//pkg/testkit/testmain",
"//pkg/testkit/testsetup",
"//pkg/util/hint",
"//pkg/util/plancodec",
"@com_github_pingcap_failpoint//:failpoint",
"@com_github_stretchr_testify//require",
"@org_uber_go_goleak//:goleak",
],
)
Loading

0 comments on commit ce91b6d

Please sign in to comment.