code: func AggregateEvalType(fts []*FieldType, flag *uint) EvalType {
  	var (
  		aggregatedEvalType = ETString
  		unsigned           bool
  		gotFirst           bool
  		gotBinString       bool
  	)
  	lft := fts[0]
  	for _, ft := range fts {
  		if ft.Tp == mysql.TypeNull {
  			continue
  		}
  		et := ft.EvalType()
  		rft := ft
  		if (IsTypeBlob(ft.Tp) || IsTypeVarchar(ft.Tp) || IsTypeChar(ft.Tp)) && mysql.HasBinaryFlag(ft.Flag) {
  			gotBinString = true
  		}
  		if !gotFirst {
  			gotFirst = true
  			aggregatedEvalType = et
  			unsigned = mysql.HasUnsignedFlag(ft.Flag)
  		} else {
  			aggregatedEvalType = mergeEvalType(aggregatedEvalType, et, lft, rft, unsigned, mysql.HasUnsignedFlag(ft.Flag))
  			unsigned = unsigned && mysql.HasUnsignedFlag(ft.Flag)
  		}
  		lft = rft
  	}
  	setTypeFlag(flag, mysql.UnsignedFlag, unsigned)
  	setTypeFlag(flag, mysql.BinaryFlag, !aggregatedEvalType.IsStringKind() || gotBinString)
  	return aggregatedEvalType
  }
docs: // AggregateEvalType aggregates arguments' EvalType of a multi-argument function.