From 94690cb76ecbeeb8418a86987b589b881d721c19 Mon Sep 17 00:00:00 2001 From: XuHuaiyu <391585975@qq.com> Date: Tue, 20 Jun 2017 18:14:32 +0800 Subject: [PATCH] expression: remove inferType interface of functionClass --- expression/builtin.go | 6 ------ expression/builtin_string_test.go | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/expression/builtin.go b/expression/builtin.go index 70050ee687ad6..8787e2dacd1f5 100644 --- a/expression/builtin.go +++ b/expression/builtin.go @@ -451,16 +451,10 @@ func (b *baseFunctionClass) verifyArgs(args []Expression) error { return nil } -func (b *baseFunctionClass) inferType(args []Expression) *types.FieldType { - return nil -} - // functionClass is the interface for a function which may contains multiple functions. type functionClass interface { // getFunction gets a function signature by the types and the counts of given arguments. getFunction(args []Expression, ctx context.Context) (builtinFunc, error) - // inferType infers the return type of a function. - inferType(args []Expression) *types.FieldType } // BuiltinFunc is the function signature for builtin functions diff --git a/expression/builtin_string_test.go b/expression/builtin_string_test.go index 126553cdbd6b9..bb3705b0fce5a 100644 --- a/expression/builtin_string_test.go +++ b/expression/builtin_string_test.go @@ -148,7 +148,6 @@ func (s *testEvaluatorSuite) TestConcat(c *C) { } } - fc := funcs[fcName] typeCases := []struct { args []Expression retType *types.FieldType @@ -170,6 +169,7 @@ func (s *testEvaluatorSuite) TestConcat(c *C) { &types.FieldType{Tp: mysql.TypeBlob, Charset: charset.CharsetBin, Collate: charset.CollationBin, Flag: mysql.BinaryFlag}, }, } + fc := funcs[fcName].(*concatFunctionClass) for _, t := range typeCases { retType := fc.inferType(t.args) c.Assert(retType.Tp, Equals, t.retType.Tp)