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

'ALTER TABLE `tbl_name` ADD CONSTRAINT UNIQUE KEY `key_name` (`colname`)' throwing exception

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 0.7.5
    • 0.7.3
    • mysql-connector
    • None

      While parsing ALTER TABLE xx ADD CONSTRAINT UNIQUE KEY xx (xx)
      The MySqlDdlParser is throwing io.debezium.text.ParsingException. PFB the error stacktrace.

      _[2018-03-15 14:33:30,944] ERROR MySQL|myntra_scm|binlog Error during binlog processing. Last offset stored = null, binlog reader near position = lms-bislave._/_ (io.debezium.connector.mysql.BinlogReader:944) [2018-03-15 14:33:30,945] ERROR MySQL|myntra_scm|binlog Failed due to error: Error processing binlog event (io.debezium.connector.mysql.BinlogReader:162) org.apache.kafka.connect.errors.ConnectException: Failed to parse statement 'ALTER TABLE `tbl_name` ADD CONSTRAINT UNIQUE KEY `key_name` (`colname`)' at
        io.debezium.connector.mysql.AbstractReader.wrap(AbstractReader.java:183) at
        io.debezium.connector.mysql.AbstractReader.failed(AbstractReader.java:161) at
        io.debezium.connector.mysql.BinlogReader.handleEvent(BinlogReader.java:443) at
        com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1055) at
        com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:913) at     
        com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:559) at 
        com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:793) at java.lang.Thread.run(Thread.java:748) Caused by: 
        io.debezium.text.ParsingException: Failed to parse statement 'ALTER TABLE `tbl_name` ADD CONSTRAINT UNIQUE KEY `key_name` (`colname`)' at 
        io.debezium.relational.ddl.DdlParser.parse(DdlParser.java:292) at io.debezium.relational.ddl.DdlParser.parse(DdlParser.java:267) at 
        io.debezium.connector.mysql.MySqlSchema.applyDdl(MySqlSchema.java:326) at 
        io.debezium.connector.mysql.BinlogReader.handleQueryEvent(BinlogReader.java:614) at 
        io.debezium.connector.mysql.BinlogReader.handleEvent(BinlogReader.java:427) 
        ... 5 more Caused by: io.debezium.text.ParsingException: Expecting token type 128 at line 1, column 66 but found 'key_name': STRAINT UNIQUE KEY ` ===>> key_name` (` at    
        io.debezium.text.TokenStream.consume(TokenStream.java:737) at
        io.debezium.relational.ddl.DdlParser.consumeStatement(DdlParser.java:568) at
        io.debezium.relational.ddl.DdlParser.parseUnknownStatement(DdlParser.java:376) at io.debezium.connector.mysql.MySqlDdlParser.parseNextStatement(MySqlDdlParser.java:176) at
        io.debezium.relational.ddl.DdlParser.parse(DdlParser.java:286) ... 9 more_
      

              jpechane Jiri Pechanec
              akashthegr8 Akash Srivastava (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: