Skip to content

Commit

Permalink
format error message when meet datum conv failure (pingcap#5689)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhexuany authored and ngaut committed Jan 22, 2018
1 parent 888bc2a commit 236e50a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions types/datum.go
Original file line number Diff line number Diff line change
Expand Up @@ -1530,8 +1530,7 @@ func (d *Datum) ToMysqlJSON() (j json.BinaryJSON, err error) {
}

func invalidConv(d *Datum, tp byte) (Datum, error) {
// TODO: should format Datum better.
return Datum{}, errors.Errorf("cannot convert %v to type %s", d, TypeStr(tp))
return Datum{}, errors.Errorf("cannot convert datum from %s to type %s.", TypeStr(d.Kind()), TypeStr(tp))
}

func (d *Datum) convergeType(hasUint, hasDecimal, hasFloat *bool) (x Datum) {
Expand Down

0 comments on commit 236e50a

Please sign in to comment.