diff --git a/pkg/sql/plan/base_binder.go b/pkg/sql/plan/base_binder.go index d73f045a96f9f1e934be4fa93ed7349a288550ec..4d007507f0efc070836847d05c9aa00060623f97 100644 --- a/pkg/sql/plan/base_binder.go +++ b/pkg/sql/plan/base_binder.go @@ -823,6 +823,14 @@ func bindFuncExprImplByPlanExpr(name string, args []*Expr) (*plan.Expr, error) { return nil, err } } + case "like": + // sql 'select * from t where col like ?' the ? Expr's type will be T_any + if args[0].Typ.Id == int32(types.T_any) { + args[0].Typ.Id = int32(types.T_varchar) + } + if args[1].Typ.Id == int32(types.T_any) { + args[1].Typ.Id = int32(types.T_varchar) + } } // get args(exprs) & types