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

Table creation DDL with `CHARACTER SET = DEFAULT` causes MySQL connector failure

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.5.0.Alpha1
    • 1.4.1.Final
    • mysql-connector
    • None

      The following table creation DDL

      CREATE SCHEMA IF NOT EXISTS `database1`;
      CREATE TABLE IF NOT EXISTS `database1`.`table1` (
      `created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
      `x1` INT NOT NULL
      ) CHARACTER SET = DEFAULT;

      will cause the MySQL Connector to fail with the following exception:

      org.apache.kafka.connect.errors.ConnectException    at io.debezium.connector.mysql.AbstractReader.wrap(AbstractReader.java:241)    at io.debezium.connector.mysql.AbstractReader.failed(AbstractReader.java:218)    at io.debezium.connector.mysql.BinlogReader.handleEvent(BinlogReader.java:607)    at com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1104)    at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:955)    at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:595)    at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:839)    at java.base/java.lang.Thread.run(Thread.java:834)Caused by: java.lang.NullPointerException    at io.debezium.antlr.AntlrDdlParser.withoutQuotes(AntlrDdlParser.java:343)    at io.debezium.connector.mysql.antlr.listener.CreateTableParserListener.lambda$enterTableOptionCharset$6(CreateTableParserListener.java:139)    at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.runIfNotNull(MySqlAntlrDdlParser.java:357)    at io.debezium.connector.mysql.antlr.listener.CreateTableParserListener.enterTableOptionCharset(CreateTableParserListener.java:138)    at io.debezium.ddl.parser.mysql.generated.MySqlParser$TableOptionCharsetContext.enterRule(MySqlParser.java:9665)    at io.debezium.antlr.ProxyParseTreeListenerUtil.delegateEnterRule(ProxyParseTreeListenerUtil.java:46)    at io.debezium.connector.mysql.antlr.listener.MySqlAntlrDdlParserListener.enterEveryRule(MySqlAntlrDdlParserListener.java:89)    at org.antlr.v4.runtime.tree.ParseTreeWalker.enterRule(ParseTreeWalker.java:41)    at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:25)    at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28)    at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28)    at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28)    at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28)    at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28)    at io.debezium.antlr.AntlrDdlParser.parse(AntlrDdlParser.java:85)    at io.debezium.connector.mysql.MySqlSchema.applyDdl(MySqlSchema.java:326)    at io.debezium.connector.mysql.BinlogReader.handleQueryEvent(BinlogReader.java:810)    at io.debezium.connector.mysql.BinlogReader.handleEvent(BinlogReader.java:590)    ... 5 more

      The DDL's syntax is a valid for MySQL, but not for the Debezium MySQL Connector.

              jpechane Jiri Pechanec
              kewei.shang kewei shang (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: