From 9cdd63f9e94e9a7411dc081d8e87b20ed007f67b Mon Sep 17 00:00:00 2001 From: Adun Chan Date: Thu, 22 Aug 2019 12:11:26 +0800 Subject: [PATCH] fix(canal): fix handleUnsigned use wrong col index --- canal/rows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/canal/rows.go b/canal/rows.go index f464acc25..4850598f4 100644 --- a/canal/rows.go +++ b/canal/rows.go @@ -58,7 +58,7 @@ func (r *RowsEvent) handleUnsigned() { case int16: r.Rows[i][index] = uint16(t) case int32: - if r.Table.Columns[i].Type == schema.TYPE_MEDIUM_INT { + if r.Table.Columns[index].Type == schema.TYPE_MEDIUM_INT { // problem with mediumint is that it's a 3-byte type. There is no compatible golang type to match that. // So to convert from negative to positive we'd need to convert the value manually if i >= 0 {