Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-901

java.time.format.DateTimeParseException: Text '1970-01-01 00:00:00' in mysql ALTER

XMLWordPrintable

      OLD PARSER!

      This alter breaks connector:

      ALTER TABLE `tbl` ADD COLUMN `col` DATETIME(3) NOT NULL DEFAULT ‘1970-01-01 00:00:00’
      
      ALTER TABLE `tbl` 
      ADD COLUMN `col` DATETIME(3) NOT NULL DEFAULT '1970-01-01 00:00:00' AFTER `deleted`,
      at io.debezium.connector.mysql.AbstractReader.wrap(AbstractReader.java:200)
      at io.debezium.connector.mysql.AbstractReader.failed(AbstractReader.java:178)
      at io.debezium.connector.mysql.BinlogReader.handleEvent(BinlogReader.java:452)
      at com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1055)
      at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:913)
      at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:559)
      at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:793)
      at java.lang.Thread.run(Thread.java:748)
      Caused by: io.debezium.text.ParsingException: Unexpected exception while parsing statement ALTER TABLE `tbl` 
      at io.debezium.relational.ddl.LegacyDdlParser.parsingFailed(LegacyDdlParser.java:555)
      at io.debezium.relational.ddl.LegacyDdlParser.parse(LegacyDdlParser.java:227)
      at io.debezium.relational.ddl.LegacyDdlParser.parse(LegacyDdlParser.java:200)
      at io.debezium.connector.mysql.MySqlSchema.applyDdl(MySqlSchema.java:298)
      at io.debezium.connector.mysql.BinlogReader.handleQueryEvent(BinlogReader.java:637)
      at io.debezium.connector.mysql.BinlogReader.handleEvent(BinlogReader.java:436)
      ... 5 more
      Caused by: java.time.format.DateTimeParseException: Text '1970-01-01 00:00:00' could not be parsed at index 19
      at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:1949)
      at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1777)
      at io.debezium.connector.mysql.MySqlDefaultValuePreConverter.convertToLocalDateTime(MySqlDefaultValuePreConverter.java:136)
      at io.debezium.connector.mysql.MySqlDefaultValuePreConverter.convert(MySqlDefaultValuePreConverter.java:58)
      at io.debezium.connector.mysql.MySqlDdlParser.convertDefaultValueToSchemaType(MySqlDdlParser.java:810)
      at io.debezium.connector.mysql.MySqlDdlParser.parseCreateColumn(MySqlDdlParser.java:771)
      at io.debezium.connector.mysql.MySqlDdlParser.parseCreateDefinition(MySqlDdlParser.java:747)
      at io.debezium.connector.mysql.MySqlDdlParser.parseAlterSpecification(MySqlDdlParser.java:1274)
      at io.debezium.connector.mysql.MySqlDdlParser.parseAlterSpecificationList(MySqlDdlParser.java:1260)
      at io.debezium.connector.mysql.MySqlDdlParser.parseAlterTable(MySqlDdlParser.java:1241)
      at io.debezium.connector.mysql.MySqlDdlParser.parseAlter(MySqlDdlParser.java:1203)
      at io.debezium.connector.mysql.MySqlDdlParser.parseNextStatement(MySqlDdlParser.java:177)
      at io.debezium.relational.ddl.LegacyDdlParser.parse(LegacyDdlParser.java:219)
      ... 9 more
      

      Can't fix by "inconsistent.schema.handling.mode":"warn"

              jpechane Jiri Pechanec
              pimpelsang Eero Koplimets (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: