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

Rename user command parsing fails

    XMLWordPrintable

Details

    Description

      I got an issue on a Mysql connector (Debezium 1.3-Final) regarding a "rename user" mysql command (Mysql server 5.7.22): RENAME USER xxxxxx@100.200.1.10 TO xxxxxx@100.200.1.20
      The command was executed by Mysql and ended up in binlog but Debezium crashed on the parsing. I did some check and tests with Debezium unit tests and found out that the IP address part should have been a single quoted string: According to Mysql doc, "Quotes are necessary to specify a user_name string containing special characters (such as space or -), or a host_name string containing special characters or wildcard characters (such as . or %)".

      The point is that it was accepted by Mysql and passed as it to binlog so Mysql is not as strict on its own rule.

      Mysql command: RENAME USER xxxxxx@100.200.1.10 TO xxxxxx@100.200.1.20;
      
      2020-11-04 13:01:24,162 ERROR Failed due to error: Error processing binlog event (io.debezium.connector.mysql.BinlogReader) [mysql:3306]
      org.apache.kafka.connect.errors.ConnectException: no viable alternative at input 'RENAME USER xxxxxx@100.200.1.10'
       at io.debezium.connector.mysql.AbstractReader.wrap(AbstractReader.java:230)
       at io.debezium.connector.mysql.AbstractReader.failed(AbstractReader.java:207)
       at io.debezium.connector.mysql.BinlogReader.handleEvent(BinlogReader.java:604)
       at com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1100)
       at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:951)
       at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:594)
       at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:838)
       at java.base/java.lang.Thread.run(Thread.java:834)
      Caused by: io.debezium.text.ParsingException: no viable alternative at input 'xxxxxx@100.200.1.10'
       at io.debezium.antlr.ParsingErrorListener.syntaxError(ParsingErrorListener.java:40)
       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:1154)
       at io.debezium.ddl.parser.mysql.generated.MySqlParser.root(MySqlParser.java:882)
       at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.parseTree(MySqlAntlrDdlParser.java:68)
       at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.parseTree(MySqlAntlrDdlParser.java:41)
       at io.debezium.antlr.AntlrDdlParser.parse(AntlrDdlParser.java:80)
       at io.debezium.connector.mysql.MySqlSchema.applyDdl(MySqlSchema.java:326)
       at io.debezium.connector.mysql.BinlogReader.handleQueryEvent(BinlogReader.java:807)
       at io.debezium.connector.mysql.BinlogReader.handleEvent(BinlogReader.java:587)
       ... 5 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:956)
       ... 12 more
      

      Attachments

        Activity

          People

            jpechane Jiri Pechanec
            gvaquez Gilles Vaquez (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: