diff --git a/executor/join_test.go b/executor/join_test.go index 7277d70d07c67..798fe6554e5d9 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 *testSuite2) 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(), }