Skip to content

Commit

Permalink
expr: fix instr function get stuck (#33380)
Browse files Browse the repository at this point in the history
close #33367
  • Loading branch information
Yisaer authored Mar 24, 2022
1 parent 5a17604 commit 0e043c6
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
5 changes: 0 additions & 5 deletions expression/expr_to_pb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1386,11 +1386,6 @@ func TestExprPushDownToTiKV(t *testing.T) {
retType: types.NewFieldType(mysql.TypeString),
args: []Expression{stringColumn, stringColumn, intColumn},
},
{
functionName: ast.Instr,
retType: types.NewFieldType(mysql.TypeInt24),
args: []Expression{stringColumn, stringColumn},
},
{
functionName: ast.Quote,
retType: types.NewFieldType(mysql.TypeString),
Expand Down
2 changes: 1 addition & 1 deletion expression/expression.go
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ func scalarExprSupportedByTiKV(sf *ScalarFunction) bool {
// string functions.
ast.Bin, ast.Unhex, ast.Locate, ast.Ord, ast.Lpad, ast.Rpad,
ast.Trim, ast.FromBase64, ast.ToBase64, ast.Upper, ast.Lower, ast.InsertFunc,
ast.MakeSet, ast.SubstringIndex, ast.Instr, ast.Quote, ast.Oct,
ast.MakeSet, ast.SubstringIndex /* ast.Instr */, ast.Quote, ast.Oct,
ast.FindInSet, ast.Repeat,
ast.Length, ast.BitLength, ast.Concat, ast.ConcatWS, ast.Replace, ast.ASCII, ast.Hex,
ast.Reverse, ast.LTrim, ast.RTrim, ast.Strcmp, ast.Space, ast.Elt, ast.Field,
Expand Down
4 changes: 0 additions & 4 deletions planner/core/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2912,10 +2912,6 @@ func TestScalarFunctionPushDown(t *testing.T) {
tk.MustQuery("explain analyze select /*+read_from_storage(tikv[t])*/ * from t where substring_index(c,c,1)").
CheckAt([]int{0, 3, 6}, rows)

rows[1][2] = "instr(test.t.c, test.t.c)"
tk.MustQuery("explain analyze select /*+read_from_storage(tikv[t])*/ * from t where instr(c,c)").
CheckAt([]int{0, 3, 6}, rows)

rows[1][2] = "quote(test.t.c)"
tk.MustQuery("explain analyze select /*+read_from_storage(tikv[t])*/ * from t where quote(c)").
CheckAt([]int{0, 3, 6}, rows)
Expand Down

0 comments on commit 0e043c6

Please sign in to comment.