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

Character set influencers are not properly parsed on default values

XMLWordPrintable

      When using the following DDL

      CREATE TABLE IF NOT EXISTS `contract_center`.`ent_folder_letter_relationship` (
      `id` BIGINT(19) UNSIGNED NOT NULL COMMENT '唯一标识',
      `layer` TINYINT(4) UNSIGNED DEFAULT _UTF8MB4'0' COMMENT '文档所属层级,0-主关联文档, 1-次关联文档',
      `deleted` TINYINT(1) NOT NULL DEFAULT _UTF8MB4'0' COMMENT '0-有效记录, 1-删除',
      `data_create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP() COMMENT '创建时间',
      `data_update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP() COMMENT '更新时间',
      PRIMARY KEY(`id`)) ENGINE = InnoDB DEFAULT CHARACTER SET = UTF8MB4;
      

      If the table is created during the streaming phase and parsed by the ANTLR parser, the parser throws the following exception:

      [2022-06-09 09:15:32,470] [ERROR] [io.debezium.connector.mysql.MySqlStreamingChangeEventSource] [] [blc-stag-mysql-contract.csugdgkkao6l.rds.cn-northwest-1.amazonaws.com.cn:3306] [undefined] [undefined] - Error during binlog processing. Last offset stored = null, binlog reader near position = mysql-bin-changelog.079156/324249 MDC: {dbz.connectorName=debezium_aws_contract_center, dbz.connectorType=MySQL, dbz.connectorContext=binlog}
      [2022-06-09 09:15:32,473] [ERROR] [io.debezium.pipeline.ErrorHandler] [] [blc-stag-mysql-contract.csugdgkkao6l.rds.cn-northwest-1.amazonaws.com.cn:3306] [undefined] [undefined] - Producer failure MDC: {dbz.connectorName=debezium_aws_contract_center, dbz.connectorType=MySQL, dbz.connectorContext=binlog}
      io.debezium.DebeziumException: Error processing binlog event
              at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleEvent(MySqlStreamingChangeEventSource.java:366)
              at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.lambda$execute$25(MySqlStreamingChangeEventSource.java:855)
              at com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1125)
              at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:973)
              at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:599)
              at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:857)
              at java.base/java.lang.Thread.run(Thread.java:829)
      Caused by: java.lang.NumberFormatException: For input string: "UTF8MB4'0"
              at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
              at java.base/java.lang.Integer.parseInt(Integer.java:652)
              at java.base/java.lang.Short.parseShort(Short.java:120)
              at java.base/java.lang.Short.valueOf(Short.java:176)
              at java.base/java.lang.Short.valueOf(Short.java:202)
              at io.debezium.jdbc.JdbcValueConverters.lambda$convertSmallInt$40(JdbcValueConverters.java:874)
              at io.debezium.jdbc.JdbcValueConverters.convertValue(JdbcValueConverters.java:1297)
              at io.debezium.jdbc.JdbcValueConverters.convertSmallInt(JdbcValueConverters.java:862)
              at io.debezium.connector.mysql.MySqlValueConverters.lambda$convertUnsignedTinyint$24(MySqlValueConverters.java:659)
              at io.debezium.jdbc.JdbcValueConverters.convertValue(JdbcValueConverters.java:1297)
              at io.debezium.connector.mysql.MySqlValueConverters.convertUnsignedTinyint(MySqlValueConverters.java:650)
              at io.debezium.connector.mysql.MySqlValueConverters.lambda$converter$7(MySqlValueConverters.java:265)
              at io.debezium.connector.mysql.MySqlDefaultValueConverter.setColumnDefaultValue(MySqlDefaultValueConverter.java:414)
              at io.debezium.connector.mysql.antlr.listener.CreateTableParserListener.convertDefaultValueToSchemaType(CreateTableParserListener.java:147)
              at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
              at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
              at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
              at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
              at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
              at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
              at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
              at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
              at io.debezium.connector.mysql.antlr.listener.CreateTableParserListener.lambda$exitColumnCreateTable$1(CreateTableParserListener.java:75)
              at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.runIfNotNull(MySqlAntlrDdlParser.java:357)
              at io.debezium.connector.mysql.antlr.listener.CreateTableParserListener.exitColumnCreateTable(CreateTableParserListener.java:55)
              at io.debezium.ddl.parser.mysql.generated.MySqlParser$ColumnCreateTableContext.exitRule(MySqlParser.java:4871)
              at io.debezium.antlr.ProxyParseTreeListenerUtil.delegateExitRule(ProxyParseTreeListenerUtil.java:64)
              at io.debezium.connector.mysql.antlr.listener.MySqlAntlrDdlParserListener.exitEveryRule(MySqlAntlrDdlParserListener.java:106)
              at org.antlr.v4.runtime.tree.ParseTreeWalker.exitRule(ParseTreeWalker.java:48)
              at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:30)
              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:87)
              at io.debezium.connector.mysql.MySqlDatabaseSchema.parseDdl(MySqlDatabaseSchema.java:216)
              at io.debezium.connector.mysql.MySqlDatabaseSchema.parseStreamingDdl(MySqlDatabaseSchema.java:202)
              at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleQueryEvent(MySqlStreamingChangeEventSource.java:573)
              at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.lambda$execute$14(MySqlStreamingChangeEventSource.java:827)
              at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleEvent(MySqlStreamingChangeEventSource.java:349)
              ... 6 common frames omitted
      

      This is due to the fact that the default value handler is not capable of handling character-set influencers needs to be adapted.

              ccranfor@redhat.com Chris Cranford
              ccranfor@redhat.com Chris Cranford
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: