From 15a3eb4b48f06bb7373e43a5f25bec98c6c27bdd Mon Sep 17 00:00:00 2001 From: xuhuaiyu <391585975@qq.com> Date: Fri, 17 Jan 2020 16:21:58 +0800 Subject: [PATCH 1/2] expression, executor: correct the funcName for wrapWithIsTrue --- executor/join_test.go | 8 ++++++++ expression/expression.go | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/executor/join_test.go b/executor/join_test.go index 7277d70d07c67..4e6962dd247ba 100644 --- a/executor/join_test.go +++ b/executor/join_test.go @@ -1427,3 +1427,11 @@ func (s *testSuite2) TestIssue11390(c *C) { tk.MustExec("insert into 11390t values(1, 1)") tk.MustQuery("select /*+ TIDB_INLJ(t1, t2) */ * from 11390t t1, 11390t t2 where t1.k2 > 0 and t1.k2 = t2.k2 and t2.k1=1;").Check(testkit.Rows("1 1 1 1")) } + +func (s *testSuiteJoin1) TestIssue14514(c *C) { + tk := testkit.NewTestKit(c, s.store) + tk.MustExec("use test") + tk.MustExec("drop table if exists t") + tk.MustExec("create table t (pk varchar(14) primary key, a varchar(12));") + tk.MustQuery("select * from (select t1.pk or '/' as c from t as t1 left join t as t2 on t1.a = t2.pk) as t where t.c = 1;").Check(testkit.Rows()) +} diff --git a/expression/expression.go b/expression/expression.go index a1322fce450f5..e487cf3a8ca5e 100644 --- a/expression/expression.go +++ b/expression/expression.go @@ -398,7 +398,7 @@ func wrapWithIsTrue(ctx sessionctx.Context, keepNull bool, arg Expression) (Expr return nil, err } sf := &ScalarFunction{ - FuncName: model.NewCIStr(fmt.Sprintf("sig_%T", f)), + FuncName: model.NewCIStr(ast.IsTruth), Function: f, RetType: f.getRetTp(), } From 9e8f2baada262e08369a18b8b8ea1b391c74abc0 Mon Sep 17 00:00:00 2001 From: xuhuaiyu <391585975@qq.com> Date: Sun, 19 Jan 2020 10:50:17 +0800 Subject: [PATCH 2/2] fix ci --- executor/join_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/executor/join_test.go b/executor/join_test.go index 4e6962dd247ba..798fe6554e5d9 100644 --- a/executor/join_test.go +++ b/executor/join_test.go @@ -1428,7 +1428,7 @@ func (s *testSuite2) TestIssue11390(c *C) { tk.MustQuery("select /*+ TIDB_INLJ(t1, t2) */ * from 11390t t1, 11390t t2 where t1.k2 > 0 and t1.k2 = t2.k2 and t2.k1=1;").Check(testkit.Rows("1 1 1 1")) } -func (s *testSuiteJoin1) TestIssue14514(c *C) { +func (s *testSuite2) TestIssue14514(c *C) { tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") tk.MustExec("drop table if exists t")