-
Bug
-
Resolution: Done
-
Major
-
0.5.2
-
- Create a MySQL table with a TIME field (like the schema below).
- Insert any value above 23:59:59 in field with the TIME datatype (e.g: 50:00:00.
- The below error will be occur
Description
If we have MySQL table schema with a TIME field, for example the following schema:
CREATE TABLE `time_bug` (
`id` int(11) NOT NULL,
`time_field` time DEFAULT NULL,
`field_2` varchar(45) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
The connector produces the following errors:
- During the Snapshot phase:
[2017-08-31 12:01:03,065] INFO Step 8: committing transaction (io.debezium.connector.mysql.SnapshotReader:520) [2017-08-31 12:01:03,066] ERROR Failed due to error: Aborting snapshot due to error when last running 'COMMIT': Illegal hour value '56' for java.sql.Time type in value '56:00:00. (io.debezium.connector.mysql.SnapshotReader:143) org.apache.kafka.connect.errors.ConnectException: Illegal hour value '56' for java.sql.Time type in value '56:00:00. Error code: 0; SQLSTATE: S1009. at io.debezium.connector.mysql.AbstractReader.wrap(AbstractReader.java:164) at io.debezium.connector.mysql.AbstractReader.failed(AbstractReader.java:142) at io.debezium.connector.mysql.SnapshotReader.execute(SnapshotReader.java:574) at java.lang.Thread.run(Thread.java:748) Caused by: java.sql.SQLException: Illegal hour value '56' for java.sql.Time type in value '56:00:00. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:897) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:886) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:860) at com.mysql.jdbc.TimeUtil.fastTimeCreate(TimeUtil.java:286) at com.mysql.jdbc.ResultSetImpl.fastTimeCreate(ResultSetImpl.java:976) at com.mysql.jdbc.ResultSetRow.getTimeFast(ResultSetRow.java:884) at com.mysql.jdbc.ByteArrayRow.getTimeFast(ByteArrayRow.java:232) at com.mysql.jdbc.ResultSetImpl.getTimeInternal(ResultSetImpl.java:5572) at com.mysql.jdbc.ResultSetImpl.getTime(ResultSetImpl.java:5340) at com.mysql.jdbc.ResultSetImpl.getObject(ResultSetImpl.java:4546) at io.debezium.connector.mysql.SnapshotReader.lambda$execute$12(SnapshotReader.java:442) at io.debezium.jdbc.JdbcConnection.query(JdbcConnection.java:389) at io.debezium.connector.mysql.SnapshotReader.execute(SnapshotReader.java:432) ... 1 more [2017-08-31 12:01:03,469] ERROR Task dbz-proto-dev-1-0 threw an uncaught and unrecoverable exception (org.apache.kafka.connect.runtime.WorkerTask:141)
- During the binlog scan phase (after the snapshot phase is completed):
2017-08-31 12:06:13,648] INFO Finished WorkerSourceTask{id=dbz-proto-dev-1-0} commitOffsets successfully in 8 ms (org.apache.kafka.connect.runtime.WorkerSourceTask:371) [2017-08-31 12:06:13,648] ERROR Task dbz-proto-dev-1-0 threw an uncaught and unrecoverable exception (org.apache.kafka.connect.runtime.WorkerTask:141) org.apache.kafka.connect.errors.ConnectException: Invalid value for HourOfDay (valid values 0 - 23): 50 at io.debezium.connector.mysql.AbstractReader.wrap(AbstractReader.java:164) at io.debezium.connector.mysql.AbstractReader.failed(AbstractReader.java:131) at io.debezium.connector.mysql.BinlogReader$ReaderThreadLifecycleListener.onEventDeserializationFailure(BinlogReader.java:707) at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:752) at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:472) at com.github.shyiko.mysql.binlog.BinaryLogClient$5.run(BinaryLogClient.java:657) at java.lang.Thread.run(Thread.java:748) Caused by: java.time.DateTimeException: Invalid value for HourOfDay (valid values 0 - 23): 50 at java.time.temporal.ValueRange.checkValidValue(ValueRange.java:311) at java.time.temporal.ChronoField.checkValidValue(ChronoField.java:703) at java.time.LocalTime.of(LocalTime.java:339) at io.debezium.connector.mysql.RowDeserializers.deserializeTimeV2(RowDeserializers.java:329) at io.debezium.connector.mysql.RowDeserializers$UpdateRowsDeserializer.deserializeTimeV2(RowDeserializers.java:148) at com.github.shyiko.mysql.binlog.event.deserialization.AbstractRowsEventDataDeserializer.deserializeCell(AbstractRowsEventDataDeserializer.java:164) at com.github.shyiko.mysql.binlog.event.deserialization.AbstractRowsEventDataDeserializer.deserializeRow(AbstractRowsEventDataDeserializer.java:132) at com.github.shyiko.mysql.binlog.event.deserialization.UpdateRowsEventDataDeserializer.deserializeRows(UpdateRowsEventDataDeserializer.java:70) at com.github.shyiko.mysql.binlog.event.deserialization.UpdateRowsEventDataDeserializer.deserialize(UpdateRowsEventDataDeserializer.java:58) at com.github.shyiko.mysql.binlog.event.deserialization.UpdateRowsEventDataDeserializer.deserialize(UpdateRowsEventDataDeserializer.java:33) at com.github.shyiko.mysql.binlog.event.deserialization.EventDeserializer.deserializeEventData(EventDeserializer.java:206) at com.github.shyiko.mysql.binlog.event.deserialization.EventDeserializer.nextEvent(EventDeserializer.java:180) at io.debezium.connector.mysql.BinlogReader$1.nextEvent(BinlogReader.java:116) at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:741) ... 3 more
- is related to
-
DBZ-522 Snapshot fails when encountering null MySQL TIME fields
-
- Closed
-