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

Debezium unable to parse DDLs in MySql with RESTRICT contstraint

    XMLWordPrintable

    Details

      Description

      When running Debezium MySql connector, the connector cannot parse DDL changes if the change has RESTRICT constraint in it.

      The exception I get comes from the BinLogReader and it's a parsing exception.

      I even tried running the Engine with the following configuration:

      .with("event.deserialization.failure.handling.mode", "warn")
      .with("include.schema.changes", "false")
      

      but it didn't help. This is critical since We can't work with debezium after this error occurs, since it's stuck on the binlog's position.

      This is the exception:

      [17-12-26 16:23:42.323 +0200] [ERROR] [blc-192.168.192.5:3306] [MySqlSchema] []-  Error parsing DDL statement and updating tables: ALTER TABLE regression.simple_3628117 drop COLUMN amount RESTRICT 
      [17-12-26 16:23:42.332 +0200] [ERROR] [blc-192.168.192.5:3306] [BinlogReader] []-  Error during binlog processing. Last offset stored = null, binlog reader near position = mysql-bin.000043/554190 
      [17-12-26 16:23:42.340 +0200] [ERROR] [blc-192.168.192.5:3306] [BinlogReader] []-  Failed due to error: Error processing binlog event 
      org.apache.kafka.connect.errors.ConnectException: Expecting token type 128 at line 1, column 58 but found 'RESTRICT':  drop COLUMN amount  ===>> RESTRICT
      	at io.debezium.connector.mysql.AbstractReader.wrap(AbstractReader.java:178) ~[debezium-connector-mysql-0.6.2.jar:0.6.2]
      	at io.debezium.connector.mysql.AbstractReader.failed(AbstractReader.java:156) ~[debezium-connector-mysql-0.6.2.jar:0.6.2]
      	at io.debezium.connector.mysql.BinlogReader.handleEvent(BinlogReader.java:362) [debezium-connector-mysql-0.6.2.jar:0.6.2]
      	at com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1055) ~[mysql-binlog-connector-java-0.13.0.jar:0.13.0]
      	at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:913) ~[mysql-binlog-connector-java-0.13.0.jar:0.13.0]
      	at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:559) ~[mysql-binlog-connector-java-0.13.0.jar:0.13.0]
      	at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:793) ~[mysql-binlog-connector-java-0.13.0.jar:0.13.0]
      	at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_65]
      Caused by: io.debezium.text.ParsingException: Expecting token type 128 at line 1, column 58 but found 'RESTRICT':  drop COLUMN amount  ===>> RESTRICT
      	at io.debezium.text.TokenStream.consume(TokenStream.java:737) ~[debezium-core-0.6.2.jar:0.6.2]
      	at io.debezium.relational.ddl.DdlParser.consumeStatement(DdlParser.java:568) ~[debezium-core-0.6.2.jar:0.6.2]
      	at io.debezium.relational.ddl.DdlParser.parseUnknownStatement(DdlParser.java:376) ~[debezium-core-0.6.2.jar:0.6.2]
      	at io.debezium.connector.mysql.MySqlDdlParser.parseNextStatement(MySqlDdlParser.java:169) ~[debezium-connector-mysql-0.6.2.jar:0.6.2]
      	at io.debezium.relational.ddl.DdlParser.parse(DdlParser.java:286) ~[debezium-core-0.6.2.jar:0.6.2]
      	at io.debezium.relational.ddl.DdlParser.parse(DdlParser.java:267) ~[debezium-core-0.6.2.jar:0.6.2]
      	at io.debezium.connector.mysql.MySqlSchema.applyDdl(MySqlSchema.java:359) ~[debezium-connector-mysql-0.6.2.jar:0.6.2]
      	at io.debezium.connector.mysql.BinlogReader.handleQueryEvent(BinlogReader.java:531) [debezium-connector-mysql-0.6.2.jar:0.6.2]
      	at io.debezium.connector.mysql.BinlogReader.handleEvent(BinlogReader.java:348) [debezium-connector-mysql-0.6.2.jar:0.6.2]
      	... 5 common frames omitted
      [17-12-26 16:23:42.352 +0200] [ERROR] [pool-8-thread-1] [EmbeddedEngine] []-  Error while trying to run connector class 'io.debezium.connector.mysql.MySqlConnector' 
      org.apache.kafka.connect.errors.ConnectException: Expecting token type 128 at line 1, column 58 but found 'RESTRICT':  drop COLUMN amount  ===>> RESTRICT
      	at io.debezium.connector.mysql.AbstractReader.wrap(AbstractReader.java:178) ~[debezium-connector-mysql-0.6.2.jar:0.6.2]
      	at io.debezium.connector.mysql.AbstractReader.failed(AbstractReader.java:156) ~[debezium-connector-mysql-0.6.2.jar:0.6.2]
      	at io.debezium.connector.mysql.BinlogReader.handleEvent(BinlogReader.java:362) ~[debezium-connector-mysql-0.6.2.jar:0.6.2]
      	at com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1055) ~[mysql-binlog-connector-java-0.13.0.jar:0.13.0]
      	at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:913) ~[mysql-binlog-connector-java-0.13.0.jar:0.13.0]
      	at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:559) ~[mysql-binlog-connector-java-0.13.0.jar:0.13.0]
      	at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:793) ~[mysql-binlog-connector-java-0.13.0.jar:0.13.0]
      	at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_65]
      Caused by: io.debezium.text.ParsingException: Expecting token type 128 at line 1, column 58 but found 'RESTRICT':  drop COLUMN amount  ===>> RESTRICT
      	at io.debezium.text.TokenStream.consume(TokenStream.java:737) ~[debezium-core-0.6.2.jar:0.6.2]
      	at io.debezium.relational.ddl.DdlParser.consumeStatement(DdlParser.java:568) ~[debezium-core-0.6.2.jar:0.6.2]
      	at io.debezium.relational.ddl.DdlParser.parseUnknownStatement(DdlParser.java:376) ~[debezium-core-0.6.2.jar:0.6.2]
      	at io.debezium.connector.mysql.MySqlDdlParser.parseNextStatement(MySqlDdlParser.java:169) ~[debezium-connector-mysql-0.6.2.jar:0.6.2]
      	at io.debezium.relational.ddl.DdlParser.parse(DdlParser.java:286) ~[debezium-core-0.6.2.jar:0.6.2]
      	at io.debezium.relational.ddl.DdlParser.parse(DdlParser.java:267) ~[debezium-core-0.6.2.jar:0.6.2]
      	at io.debezium.connector.mysql.MySqlSchema.applyDdl(MySqlSchema.java:359) ~[debezium-connector-mysql-0.6.2.jar:0.6.2]
      	at io.debezium.connector.mysql.BinlogReader.handleQueryEvent(BinlogReader.java:531) ~[debezium-connector-mysql-0.6.2.jar:0.6.2]
      	at io.debezium.connector.mysql.BinlogReader.handleEvent(BinlogReader.java:348) ~[debezium-connector-mysql-0.6.2.jar:0.6.2]
      	... 5 common frames omitted
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                jpechanec Jiri Pechanec
                Reporter:
                orr.ganani Orr Ganani
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: