Skip to content

Commit

Permalink
expression: refine the type infer of group_concat (#5582)
Browse files Browse the repository at this point in the history
  • Loading branch information
XuHuaiyu committed Jan 8, 2018
1 parent 6c2fe07 commit c17edb1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion expression/aggregation/concat.go
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/juju/errors"
"github.com/pingcap/tidb/mysql"
"github.com/pingcap/tidb/sessionctx/variable"
"github.com/pingcap/tidb/util/charset"
"github.com/pingcap/tidb/util/types"
)

Expand All @@ -40,7 +41,11 @@ func (cf *concatFunction) Clone() Aggregation {

// GetType implements Aggregation interface.
func (cf *concatFunction) GetType() *types.FieldType {
return types.NewFieldType(mysql.TypeVarString)
retType := types.NewFieldType(mysql.TypeVarString)
retType.Charset = charset.CharsetUTF8
retType.Collate = charset.CollationUTF8
retType.Flen, retType.Decimal = mysql.MaxBlobWidth, 0
return retType
}

func (cf *concatFunction) writeValue(ctx *AggEvaluateContext, val types.Datum) {
Expand Down

0 comments on commit c17edb1

Please sign in to comment.