Skip to content

Commit

Permalink
types: Convert function
Browse files Browse the repository at this point in the history
Address comment
  • Loading branch information
shenli committed Sep 6, 2015
1 parent d1b3e2d commit 615110e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions util/types/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ func Convert(val interface{}, target *FieldType) (v interface{}, err error) { //
// TODO: consider target.Charset/Collate
x = truncateStr(x, target.Flen)
if target.Charset == charset.CharsetBin {
bx := []byte(x)
return bx, nil
return []byte(x), nil
}
return x, nil
case mysql.TypeBlob:
Expand All @@ -84,8 +83,7 @@ func Convert(val interface{}, target *FieldType) (v interface{}, err error) { //
}
x = truncateStr(x, target.Flen)
if target.Charset == charset.CharsetBin {
bx := []byte(x)
return bx, nil
return []byte(x), nil
}
return x, nil
case mysql.TypeDuration:
Expand Down

1 comment on commit 615110e

@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.