Skip to content

Commit

Permalink
Fix unknown type for mediumint (#962)
Browse files Browse the repository at this point in the history
  • Loading branch information
july2993 authored May 12, 2020
1 parent dcc9047 commit 12b6ed5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drainer/translator/kafka.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ func DatumToColumn(colInfo *model.ColumnInfo, datum types.Datum) (col *obinlog.C
col.StringValue = proto.String(str)

// numeric type
case "int", "bigint", "smallint", "tinyint":
// https://dev.mysql.com/doc/refman/8.0/en/integer-types.html
case "int", "bigint", "smallint", "tinyint", "mediumint":
str := fmt.Sprintf("%v", datum.GetValue())
if mysql.HasUnsignedFlag(colInfo.Flag) {
val, err := strconv.ParseUint(str, 10, 64)
Expand Down

0 comments on commit 12b6ed5

Please sign in to comment.