Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Defined2014 committed Dec 2, 2021
1 parent ae39e53 commit a2e124a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 6 additions & 0 deletions expression/builtin_string_vec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,12 @@ var vecBuiltinStringCases = map[string][]vecExprBenchCase{
geners: []dataGenerator{&charInt64Gener{}, &charInt64Gener{}, &charInt64Gener{}, nil},
constants: []*Constant{nil, nil, nil, {Value: types.NewDatum("ascii"), RetType: types.NewFieldType(mysql.TypeString)}},
},
{
retEvalType: types.ETString,
childrenTypes: []types.EvalType{types.ETInt, types.ETInt, types.ETInt, types.ETString},
geners: []dataGenerator{&charInt64Gener{}, nil, &charInt64Gener{}, nil},
constants: []*Constant{nil, nil, nil, {Value: types.NewDatum("ascii"), RetType: types.NewFieldType(mysql.TypeString)}},
},
},
ast.FindInSet: {
{retEvalType: types.ETInt, childrenTypes: []types.EvalType{types.ETString, types.ETString}},
Expand Down
9 changes: 4 additions & 5 deletions expression/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10653,13 +10653,12 @@ func (s *testIntegrationSuite) TestIssue29755(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")

tk.MustExec("drop table if exists t")
tk.MustExec("create table t(a int);")
tk.MustExec("insert into t values (NULL), (0x61);")
tk.MustExec("set tidb_enable_vectorized_expression = on;")
tk.MustQuery("select char(a) from t;").Check(testkit.Rows("", "a"))
tk.MustQuery("select char(123, NULL, 123)").Check(testkit.Rows("{{"))
tk.MustQuery("select char(NULL, 123, 123)").Check(testkit.Rows("{{"))
tk.MustExec("set tidb_enable_vectorized_expression = off;")
tk.MustQuery("select char(a) from t;").Check(testkit.Rows("", "a"))
tk.MustQuery("select char(123, NULL, 123)").Check(testkit.Rows("{{"))
tk.MustQuery("select char(NULL, 123, 123)").Check(testkit.Rows("{{"))
}

func (s *testIntegrationSuite) TestIssue30101(c *C) {
Expand Down

0 comments on commit a2e124a

Please sign in to comment.