Skip to content

Commit

Permalink
*: Address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
shenli committed Oct 14, 2015
1 parent 25b571b commit 641aeab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions tidb-server/server/driver_tidb.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
mysql "github.com/pingcap/tidb/mysqldef"
"github.com/pingcap/tidb/rset"
"github.com/pingcap/tidb/util/errors2"
"github.com/pingcap/tidb/util/types"
)

// TiDBDriver implements IDriver.
Expand Down Expand Up @@ -272,12 +273,12 @@ func convertColumnInfo(fld *field.ResultField) (ci *ColumnInfo) {
ci.Schema = fld.DBName
ci.Flag = uint16(fld.Flag)
ci.Charset = uint16(mysql.CharsetIDs[fld.Charset])
if fld.Flen == -1 {
if fld.Flen == types.UnspecifiedLength {
ci.ColumnLength = 0
} else {
ci.ColumnLength = uint32(fld.Flen)
}
if fld.Decimal == -1 {
if fld.Decimal == types.UnspecifiedLength {
ci.Decimal = 0
} else {
ci.Decimal = uint8(fld.Decimal)
Expand Down
2 changes: 1 addition & 1 deletion util/types/field_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func NewFieldType(tp byte) *FieldType {
}
}

// CompactStr only consider Tp/CharsetBin/Flen/Deimal.
// CompactStr only considers Tp/CharsetBin/Flen/Deimal.
// This is used for showing column type in infoschema.
func (ft *FieldType) CompactStr() string {
ts := TypeToStr(ft.Tp, ft.Charset)
Expand Down

1 comment on commit 641aeab

@qiuyesuifeng
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Please sign in to comment.