Skip to content

Commit

Permalink
expression: enable strcmp for tiflash (#30983)
Browse files Browse the repository at this point in the history
  • Loading branch information
ichn-hu authored Dec 29, 2021
1 parent c06ecb4 commit fcfd838
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions expression/expr_to_pb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,11 @@ func TestExprPushDownToFlash(t *testing.T) {
require.NoError(t, err)
exprs = append(exprs, function)

// strcmp
function, err = NewFunction(mock.NewContext(), ast.Strcmp, types.NewFieldType(mysql.TypeLonglong), stringColumn, stringColumn)
require.NoError(t, err)
exprs = append(exprs, function)

pushed, remained = PushDownExprs(sc, exprs, client, kv.TiFlash)
require.Len(t, pushed, len(exprs))
require.Len(t, remained, 0)
Expand Down
2 changes: 1 addition & 1 deletion expression/expression.go
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ func scalarExprSupportedByFlash(function *ScalarFunction) bool {
}
case
ast.LogicOr, ast.LogicAnd, ast.UnaryNot, ast.BitNeg, ast.Xor, ast.And, ast.Or,
ast.GE, ast.LE, ast.EQ, ast.NE, ast.LT, ast.GT, ast.In, ast.IsNull, ast.Like,
ast.GE, ast.LE, ast.EQ, ast.NE, ast.LT, ast.GT, ast.In, ast.IsNull, ast.Like, ast.Strcmp,
ast.Plus, ast.Minus, ast.Div, ast.Mul, ast.Abs, ast.Mod,
ast.If, ast.Ifnull, ast.Case,
ast.Concat, ast.ConcatWS,
Expand Down
6 changes: 3 additions & 3 deletions tools/check/ut.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
package main

import (
"io"
"bytes"
"fmt"
"io"
"math/rand"
"os"
"os/exec"
Expand Down Expand Up @@ -354,7 +354,7 @@ func (n *numa) worker(wg *sync.WaitGroup, ch chan task) {
}

type testResult struct {
err error
err error
output bytes.Buffer
}

Expand Down Expand Up @@ -449,7 +449,7 @@ func numactlExist() bool {

func testFileName(pkg string) string {
_, file := path.Split(pkg)
return file+".test.bin"
return file + ".test.bin"
}

func testFileFullPath(pkg string) string {
Expand Down

0 comments on commit fcfd838

Please sign in to comment.