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

Debezium crashes on parsing MySQL DDL statement (specific INSERT)

    XMLWordPrintable

Details

    Description

      Debezium crashes while parsing this statement:

       

      DROP PROCEDURE IF EXISTS test_error; 
      
      CREATE PROCEDURE `test_error`()
      BEGIN	
        INSERT INTO test_auto_inc ()				
        VALUES ();
      END
      -- table example
      CREATE TABLE `test_auto_inc` 
      (  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
       PRIMARY KEY (`id`)) 

      Bug report

      For bug reports, provide this information, please:

      What Debezium connector do you use and what version?

      2.4.0.Final

      What is the captured database version and mode of depoyment?

      (Percona (Mysql 5.7.41)

      Do you have the connector logs, ideally from start till finish?

      (You might be asked later to provide DEBUG/TRACE level log)

      [2023-11-08 08:09:49,493] INFO [connector-sandbox-115|task-0] Already applied 17 database changes (io.debezium.relational.history.SchemaHistoryMetrics:140)

      [2023-11-08 08:09:58,809] ERROR [connector-sandbox-115|task-0] Error during binlog processing. Last offset stored = {transaction_id=null, ts_sec=1699430989, file=mysql-bin.001374, pos=90542034, gtids=2a9728ee-de91-11ed-96f3-6a32bf6e31c4:1-733220, server_id=1, event=1}, binlog reader near position = mysql-bin.001374/90542034 (io.debezium.connector.mysql.MySqlStreamingChangeEventSource:1161)

      [2023-11-08 08:09:58,810] ERROR [connector-sandbox-115|task-0] Producer failure (io.debezium.pipeline.ErrorHandler:52)

      io.debezium.DebeziumException: Error processing binlog event

      at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleEvent(MySqlStreamingChangeEventSource.java:395)

      at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.lambda$execute$27(MySqlStreamingChangeEventSource.java:930)

      at com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1246)

      at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:1072)

      at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:631)

      at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:932)

      at java.base/java.lang.Thread.run(Thread.java:829)

      Caused by: io.debezium.text.ParsingException: DDL statement couldn't be parsed. Please open a Jira issue with the statement 'CREATE DEFINER=`peuser`@`%` PROCEDURE `test_error`()

      BEGIN

      INSERT INTO test_auto_inc ()

      VALUES ();

      END'

      no viable alternative at input 'CREATE DEFINER=`peuser`@`%` PROCEDURE `test_error`()\nBEGIN\n\tINSERT INTO test_auto_inc ()\n\t\t\t\tVALUES'

      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:543)

      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:1272)

      at io.debezium.ddl.parser.mysql.generated.MySqlParser.root(MySqlParser.java:988)

      at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.parseTree(MySqlAntlrDdlParser.java:74)

      at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.parseTree(MySqlAntlrDdlParser.java:46)

      at io.debezium.antlr.AntlrDdlParser.parse(AntlrDdlParser.java:78)

      at io.debezium.connector.mysql.MySqlDatabaseSchema.parseDdl(MySqlDatabaseSchema.java:213)

      at io.debezium.connector.mysql.MySqlDatabaseSchema.parseStreamingDdl(MySqlDatabaseSchema.java:199)

      at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleQueryEvent(MySqlStreamingChangeEventSource.java:593)

      at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.lambda$execute$15(MySqlStreamingChangeEventSource.java:901)

      at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleEvent(MySqlStreamingChangeEventSource.java:375)

      ... 6 more

      Caused by: org.antlr.v4.runtime.NoViableAltException

      at org.antlr.v4.runtime.atn.ParserATNSimulator.noViableAlt(ParserATNSimulator.java:2028)

      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:1064)

      ... 15 more

      [2023-11-08 08:09:58,813] INFO [connector-sandbox-115|task-0] Error processing binlog event, and propagating to Kafka Connect so it stops this connector. Future binlog events read before connector is shutdown will be ignored. (io.debezium.connect

      or.mysql.MySqlStreamingChangeEventSource:400)

      [2023-11-08 08:09:59,163] ERROR [connector-sandbox-115|task-0] WorkerSourceTask{id=connector-sandbox-115-0} Task threw an uncaught and unrecoverable exception. Task is being killed and will not recover until manually restarted (org.apach

      e.kafka.connect.runtime.WorkerTask:210)

      org.apache.kafka.connect.errors.ConnectException: An exception occurred in the change event producer. This connector will be stopped.

      at io.debezium.pipeline.ErrorHandler.setProducerThrowable(ErrorHandler.java:67)

      connect.log        [-M--] 47 L:[4370+40 4410/4460] *(366654/373685b)  112 0x070                                                                                                                                                                          [*][X]

      <------>at org.antlr.v4.runtime.atn.ParserATNSimulator.noViableAlt(ParserATNSimulator.java:2028)

      <------>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:1064)

      <------>... 15 more

      [2023-11-08 08:09:58,813] INFO [connector-sandbox-115|task-0] Error processing binlog event, and propagating to Kafka Connect so it stops this connector. Future binlog events read before connector is shutdown will be ignored. (io.debezium.connect

      [2023-11-08 08:09:59,163] ERROR [connector-sandbox-115|task-0] WorkerSourceTask{id=connector-sandbox-115-0} Task threw an uncaught and unrecoverable exception. Task is being killed and will not recover until manually restarted (org.apach

      org.apache.kafka.connect.errors.ConnectException: An exception occurred in the change event producer. This connector will be stopped.

      <------>at io.debezium.pipeline.ErrorHandler.setProducerThrowable(ErrorHandler.java:67)

      <------>at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleEvent(MySqlStreamingChangeEventSource.java:395)

      <------>at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.lambda$execute$27(MySqlStreamingChangeEventSource.java:930)

      <------>at com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1246)

      <------>at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:1072)

      <------>at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:631)

      <------>at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:932)

      <------>at java.base/java.lang.Thread.run(Thread.java:829)

      Caused by: io.debezium.DebeziumException: Error processing binlog event

      <------>... 7 more

      Caused by: io.debezium.text.ParsingException: DDL statement couldn't be parsed. Please open a Jira issue with the statement 'CREATE DEFINER=`peuser`@`%` PROCEDURE `test_error`()

      BEGIN

      <------>INSERT INTO test_auto_inc ()

      <----{}><{}--{}><{}--{}><{}---->VALUES ();

      END'

      no viable alternative at input 'CREATE DEFINER=`peuser`@`%` PROCEDURE `test_error`()\nBEGIN\n\tINSERT INTO test_auto_inc ()\n\t\t\t\tVALUES'

      <------>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:543)

      <------>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:1272)

      <------>at io.debezium.ddl.parser.mysql.generated.MySqlParser.root(MySqlParser.java:988)

      <------>at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.parseTree(MySqlAntlrDdlParser.java:74)

      <------>at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.parseTree(MySqlAntlrDdlParser.java:46)

      <------>at io.debezium.antlr.AntlrDdlParser.parse(AntlrDdlParser.java:78)

      <------>at io.debezium.connector.mysql.MySqlDatabaseSchema.parseDdl(MySqlDatabaseSchema.java:213)

      <------>at io.debezium.connector.mysql.MySqlDatabaseSchema.parseStreamingDdl(MySqlDatabaseSchema.java:199)

      <------>at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleQueryEvent(MySqlStreamingChangeEventSource.java:593)

      <------>at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.lambda$execute$15(MySqlStreamingChangeEventSource.java:901)

      <------>at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleEvent(MySqlStreamingChangeEventSource.java:375)

      <------>... 6 more

      Caused by: org.antlr.v4.runtime.NoViableAltException

      <------>at org.antlr.v4.runtime.atn.ParserATNSimulator.noViableAlt(ParserATNSimulator.java:2028)

      <------>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:1064)

      <------>... 15 more

      [2023-11-08 08:09:59,164] INFO [connector-sandbox-115|task-0] Stopping down connector (io.debezium.connector.common.BaseSourceTask:284)

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            nekkett Nikita Koposov
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: