diff --git a/go.mod b/go.mod index 08135b2bc61e1..c8c67e37be723 100644 --- a/go.mod +++ b/go.mod @@ -47,7 +47,7 @@ require ( github.com/pingcap/errors v0.11.0 github.com/pingcap/goleveldb v0.0.0-20171020122428-b9ff6c35079e github.com/pingcap/kvproto v0.0.0-20181105061835-1b5d69cd1d26 - github.com/pingcap/parser v0.0.0-20181211024540-4e6d047fcaae + github.com/pingcap/parser v0.0.0-20181211162423-79b42ecfaf70 github.com/pingcap/pd v2.1.0-rc.4+incompatible github.com/pingcap/tidb-tools v0.0.0-20181112132202-4860a0d5de03 github.com/pingcap/tipb v0.0.0-20181012112600-11e33c750323 diff --git a/go.sum b/go.sum index be57fc9899053..5f0ee174ad048 100644 --- a/go.sum +++ b/go.sum @@ -107,8 +107,8 @@ github.com/pingcap/goleveldb v0.0.0-20171020122428-b9ff6c35079e h1:P73/4dPCL96rG github.com/pingcap/goleveldb v0.0.0-20171020122428-b9ff6c35079e/go.mod h1:O17XtbryoCJhkKGbT62+L2OlrniwqiGLSqrmdHCMzZw= github.com/pingcap/kvproto v0.0.0-20181105061835-1b5d69cd1d26 h1:JK4VLNYbSn36QSbCnqALi2ySXdH0DfcMssT/zmLf4Ls= github.com/pingcap/kvproto v0.0.0-20181105061835-1b5d69cd1d26/go.mod h1:0gwbe1F2iBIjuQ9AH0DbQhL+Dpr5GofU8fgYyXk+ykk= -github.com/pingcap/parser v0.0.0-20181211024540-4e6d047fcaae h1:RD98+89F/yakFLnztEL4Pi9f+RkOAm2vgRJcB1p6tTw= -github.com/pingcap/parser v0.0.0-20181211024540-4e6d047fcaae/go.mod h1:1FNvfp9+J0wvc4kl8eGNh7Rqrxveg15jJoWo/a0uHwA= +github.com/pingcap/parser v0.0.0-20181211162423-79b42ecfaf70 h1:dW8wizFPMrwPyTPXRDA7op3GLi//BM3tXUPith4nBV8= +github.com/pingcap/parser v0.0.0-20181211162423-79b42ecfaf70/go.mod h1:1FNvfp9+J0wvc4kl8eGNh7Rqrxveg15jJoWo/a0uHwA= github.com/pingcap/pd v2.1.0-rc.4+incompatible h1:/buwGk04aHO5odk/+O8ZOXGs4qkUjYTJ2UpCJXna8NE= github.com/pingcap/pd v2.1.0-rc.4+incompatible/go.mod h1:nD3+EoYes4+aNNODO99ES59V83MZSI+dFbhyr667a0E= github.com/pingcap/tidb-tools v0.0.0-20181112132202-4860a0d5de03 h1:xVuo5U+l6XAWHsb+xhkZ8zz3jerIwDfCHAO6kR2Kaog= diff --git a/planner/core/expression_rewriter.go b/planner/core/expression_rewriter.go index 1a2432abf4aca..2a4af05983ace 100644 --- a/planner/core/expression_rewriter.go +++ b/planner/core/expression_rewriter.go @@ -1242,7 +1242,7 @@ func (er *expressionRewriter) funcCallToExpression(v *ast.FuncCallExpr) { er.ctxStack = er.ctxStack[:stackLen-len(v.Args)] if _, ok := expression.DeferredFunctions[v.FnName.L]; er.useCache() && ok { function, er.err = expression.NewFunctionBase(er.ctx, v.FnName.L, &v.Type, args...) - c := &expression.Constant{Value: types.NewDatum(nil), RetType: types.CloneFieldType(function.GetType()), DeferredExpr: function} + c := &expression.Constant{Value: types.NewDatum(nil), RetType: function.GetType().Clone(), DeferredExpr: function} er.ctxStack = append(er.ctxStack, c) } else { function, er.err = expression.NewFunction(er.ctx, v.FnName.L, &v.Type, args...) diff --git a/types/field_type.go b/types/field_type.go index 8f5c0edbb71a5..602c27ca9a34f 100644 --- a/types/field_type.go +++ b/types/field_type.go @@ -40,12 +40,6 @@ func NewFieldType(tp byte) *FieldType { } } -// CloneFieldType clones the given FieldType. -func CloneFieldType(src *FieldType) *FieldType { - ft := *src - return &ft -} - // AggFieldType aggregates field types for a multi-argument function like `IF`, `IFNULL`, `COALESCE` // whose return type is determined by the arguments' FieldTypes. // Aggregation is performed by MergeFieldType function.