Skip to content

Commit e26e2d7

Browse files
committed
fix(AbstractRowsEventDataDeserializer): add microsecond precision for time
1 parent a0090e5 commit e26e2d7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/com/github/shyiko/mysql/binlog/event/deserialization/AbstractRowsEventDataDeserializer.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.io.IOException;
2323
import java.io.Serializable;
2424
import java.math.BigDecimal;
25+
import java.sql.Time;
2526
import java.util.BitSet;
2627
import java.util.Calendar;
2728
import java.util.Map;
@@ -265,7 +266,7 @@ protected Serializable deserializeTime(ByteArrayInputStream inputStream) throws
265266
if (deserializeDateAndTimeAsLong) {
266267
return castTimestamp(timestamp, 0);
267268
}
268-
return timestamp != null ? new java.sql.Time(timestamp) : null;
269+
return timestamp != null ? new java.sql.Timestamp(timestamp) : null;
269270
}
270271

271272
protected Serializable deserializeTimeV2(int meta, ByteArrayInputStream inputStream) throws IOException {
@@ -293,7 +294,7 @@ protected Serializable deserializeTimeV2(int meta, ByteArrayInputStream inputStr
293294
if (deserializeDateAndTimeAsLong) {
294295
return castTimestamp(timestamp, fsp);
295296
}
296-
return timestamp != null ? new java.sql.Time(timestamp) : null;
297+
return timestamp != null ? convertLongTimestamptWithFSP(timestamp, fsp) : null;
297298
}
298299

299300
protected Serializable deserializeTimestamp(ByteArrayInputStream inputStream) throws IOException {

0 commit comments

Comments
 (0)