diff --git a/replication/row_event.go b/replication/row_event.go index 259431538..60e91cae6 100644 --- a/replication/row_event.go +++ b/replication/row_event.go @@ -1059,7 +1059,7 @@ func (e *RowsEvent) decodeValue(data []byte, tp byte, meta uint16) (v interface{ n = 4 t := binary.LittleEndian.Uint32(data) if t == 0 { - v = formatZeroTime(0, 0) + v = nil } else { v = e.parseFracTime(fracTime{ Time: time.Unix(int64(t), 0), @@ -1068,13 +1068,17 @@ func (e *RowsEvent) decodeValue(data []byte, tp byte, meta uint16) (v interface{ }) } case MYSQL_TYPE_TIMESTAMP2: - v, n, err = decodeTimestamp2(data, meta, e.timestampStringLocation) - v = e.parseFracTime(v) + if meta == 0 { + v = nil + } else { + v, n, err = decodeTimestamp2(data, meta, e.timestampStringLocation) + v = e.parseFracTime(v) + } case MYSQL_TYPE_DATETIME: n = 8 i64 := binary.LittleEndian.Uint64(data) if i64 == 0 { - v = formatZeroTime(0, 0) + v = nil } else { d := i64 / 1000000 t := i64 % 1000000