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

Mysql-Connector fails parsing invalid decimal format DDL statement

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.7.0.CR1
    • None
    • mysql-connector
    • None

      DDL:

      create table t_receive_balance_update_01(
      
      id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增主键' PRIMARY KEY,
      
      payment_type varchar(10) null,
      
      receive_plan_id varchar(50) null,
      
      sum_amount *DECIMAL(18.2)* null,
      
      KEY `idx_receive_plan_0804` (`receive_plan_id`) USING BTREE
      
      )
      

      This statement which contained a invalid decimal format, but executed successfully in mysql, we should handler this case.

      [2021-09-09 11:33:19,137] ERROR Producer failure (io.debezium.pipeline.ErrorHandler:31)
      
      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:842)
      
      at com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1118)
      
      at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:966)
      
      at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:606)
      
      at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:850)
      
      at java.lang.Thread.run(Thread.java:748)
      
      Caused by: io.debezium.text.ParsingException: DDL statement couldn't be parsed. Please open a Jira issue with the statement '/* ApplicationName=DBeaver 21.0.5 - SQLEditor <Script.sql> */
      
      create table t_receive_balance_update_01(
      
      id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增主键' PRIMARY KEY,
      
      payment_type varchar(10) null,
      
      receive_plan_id varchar(50) null,
      
      sum_amount DECIMAL(18.2) null,
      
      KEY `idx_receive_plan_0804` (`receive_plan_id`) USING BTREE
      
      )'
      
      no viable alternative at input 'create table t_receive_balance_update_01(\nid bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增主键' PRIMARY KEY,\npayment_type varchar(10) null,\nreceive_plan_id varchar(50) null,\nsum_amount DECIMAL(18.2'
      
      at io.debezium.antlr.ParsingErrorListener.syntaxError(ParsingErrorListener.java:43)
      
      at org.antlr.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:41)
      
      at org.antlr.v4.runtime.Parser.notifyErrorListeners(Parser.java:544)
      
      at org.antlr.v4.runtime.DefaultErrorStrategy.reportNoViableAlternative(DefaultErrorStrategy.java:310)
      
      at org.antlr.v4.runtime.DefaultErrorStrategy.reportError(DefaultErrorStrategy.java:136)
      
      at io.debezium.ddl.parser.mysql.generated.MySqlParser.sqlStatements(MySqlParser.java:1191)
      
      at io.debezium.ddl.parser.mysql.generated.MySqlParser.root(MySqlParser.java:919)
      
      at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.parseTree(MySqlAntlrDdlParser.java:72)
      
      at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.parseTree(MySqlAntlrDdlParser.java:45)
      
      at io.debezium.antlr.AntlrDdlParser.parse(AntlrDdlParser.java:82)
      
      at io.debezium.connector.mysql.MySqlDatabaseSchema.parseDdl(MySqlDatabaseSchema.java:213)
      
      at io.debezium.connector.mysql.MySqlDatabaseSchema.parseStreamingDdl(MySqlDatabaseSchema.java:200)
      
      at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleQueryEvent(MySqlStreamingChangeEventSource.java:571)
      
      at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.lambda$execute$14(MySqlStreamingChangeEventSource.java:814)
      
      at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleEvent(MySqlStreamingChangeEventSource.java:349)
      
      ... 6 more
      
      Caused by: org.antlr.v4.runtime.NoViableAltException
      
      at org.antlr.v4.runtime.atn.ParserATNSimulator.noViableAlt(ParserATNSimulator.java:2026)
      
      at org.antlr.v4.runtime.atn.ParserATNSimulator.execATN(ParserATNSimulator.java:467)
      
      at org.antlr.v4.runtime.atn.ParserATNSimulator.adaptivePredict(ParserATNSimulator.java:393)
      
      at io.debezium.ddl.parser.mysql.generated.MySqlParser.sqlStatements(MySqlParser.java:993)
      
      ... 15 more
      

              Unassigned Unassigned
              ywyuewei Harvey Yue (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: