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

ParsingException for GRANT SELECT on

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • None
    • 0.9.5.Final
    • mysql-connector
    • None
    • Hide

      Run the following query

      CREATE USER 'user'@'%' IDENTIFIED BY '*****';
      GRANT SELECT on db2.table TO 'user'@'%' WITH MAX_USER_CONNECTIONS 20;
      GRANT SELECT on db1.table TO 'user'@'%' WITH MAX_USER_CONNECTIONS 20;
      FLUSH PRIVILEGES;
      
      Show
      Run the following query CREATE USER ' user ' @ '%' IDENTIFIED BY '*****' ; GRANT SELECT on db2. table TO ' user ' @ '%' WITH MAX_USER_CONNECTIONS 20; GRANT SELECT on db1. table TO ' user ' @ '%' WITH MAX_USER_CONNECTIONS 20; FLUSH PRIVILEGES ;

      Running the following query

      CREATE USER 'user'@'%' IDENTIFIED BY '*****';
      GRANT SELECT on db1.TABLE TO 'user'@'%' WITH MAX_USER_CONNECTIONS 20;
      GRANT SELECT on db2.TABLE TO 'user'@'%' WITH MAX_USER_CONNECTIONS 20;
      FLUSH PRIVILEGES;
      

      Generates the following error in debezium

      debezium_1 | org.apache.kafka.connect.errors.ConnectException: no viable alternative at input 'GRANT SELECT on db1.TABLE'
      debezium_1 | at io.debezium.connector.mysql.AbstractReader.wrap(AbstractReader.java:230)
      debezium_1 | at io.debezium.connector.mysql.AbstractReader.failed(AbstractReader.java:208)
      debezium_1 | at io.debezium.connector.mysql.BinlogReader.handleEvent(BinlogReader.java:508)
      debezium_1 | at com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1095)
      debezium_1 | at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:943)
      debezium_1 | at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:580)
      debezium_1 | at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:825)
      debezium_1 | at java.lang.Thread.run(Thread.java:748)
      debezium_1 | Caused by: io.debezium.text.ParsingException: no viable alternative at input 'GRANT SELECT on db1.TABLE'
      debezium_1 | at io.debezium.antlr.ParsingErrorListener.syntaxError(ParsingErrorListener.java:40)
      debezium_1 | at org.antlr.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:41)
      debezium_1 | at org.antlr.v4.runtime.Parser.notifyErrorListeners(Parser.java:544)
      debezium_1 | at org.antlr.v4.runtime.DefaultErrorStrategy.reportNoViableAlternative(DefaultErrorStrategy.java:282)
      debezium_1 | at org.antlr.v4.runtime.DefaultErrorStrategy.reportError(DefaultErrorStrategy.java:121)
      debezium_1 | at io.debezium.ddl.parser.mysql.generated.MySqlParser.sqlStatements(MySqlParser.java:1078)
      debezium_1 | at io.debezium.ddl.parser.mysql.generated.MySqlParser.root(MySqlParser.java:812)
      debezium_1 | at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.parseTree(MySqlAntlrDdlParser.java:68)
      debezium_1 | at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.parseTree(MySqlAntlrDdlParser.java:41)
      debezium_1 | at io.debezium.antlr.AntlrDdlParser.parse(AntlrDdlParser.java:80)
      debezium_1 | at io.debezium.connector.mysql.MySqlSchema.applyDdl(MySqlSchema.java:307)
      debezium_1 | at io.debezium.connector.mysql.BinlogReader.handleQueryEvent(BinlogReader.java:694)
      debezium_1 | at io.debezium.connector.mysql.BinlogReader.handleEvent(BinlogReader.java:492)
      debezium_1 | ... 5 more
      debezium_1 | Caused by: org.antlr.v4.runtime.NoViableAltException
      debezium_1 | at org.antlr.v4.runtime.atn.ParserATNSimulator.noViableAlt(ParserATNSimulator.java:2023)
      debezium_1 | at org.antlr.v4.runtime.atn.ParserATNSimulator.execATN(ParserATNSimulator.java:467)
      debezium_1 | at org.antlr.v4.runtime.atn.ParserATNSimulator.adaptivePredict(ParserATNSimulator.java:393)
      debezium_1 | at io.debezium.ddl.parser.mysql.generated.MySqlParser.sqlStatements(MySqlParser.java:886)
      debezium_1 | ... 12 more

              ccranfor@redhat.com Chris Cranford
              gradano-c4w Gianpiero Radano (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: