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

Failure to parse the create table statement when specify the on update in datetime field

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Done
    • Affects Version/s: 0.3.5
    • Fix Version/s: 0.3.6, 0.4
    • Component/s: mysql-connector
    • Labels:
      None
    • Environment:

      MySQL: 5.6.23-enterprise-commercial-advanced-log
      Kafka: 0.10.0

    • Steps to Reproduce:
      Hide

      use following statement can reproduce the error:

      create table secondtry (
         orderid int primary key auto_increment,
         createtime datetime,
         modifiedtime datetime on update now(),
         status char(4)
      );
      
      Show
      use following statement can reproduce the error: create table secondtry ( orderid int primary key auto_increment , createtime datetime , modifiedtime datetime on update now(), status char (4) );

      Description

      When I create a new table with following statement the debezium will throw ParsingException.

      create table secondtry (
         orderid int primary key auto_increment,
         createtime datetime,
         modifiedtime datetime on update now(),
         status char(4)
      );
      

      Here is the error log.

      [2016-12-20 16:38:18,000] ERROR Error parsing DDL statement and updating tables: create table secondtry (
         orderid int primary key auto_increment,
         createtime datetime,
         modifiedtime datetime on update now(),
         status char(4)
      ) (io.debezium.connector.mysql.MySqlSchema:333)
      io.debezium.text.ParsingException: Expecting ')' at line 4, column 39 but found '(': tetime on update now ===>> (),
         status char(4
      	at io.debezium.text.TokenStream.consume(TokenStream.java:694)
      	at io.debezium.connector.mysql.MySqlDdlParser.parseCreateDefinitionList(MySqlDdlParser.java:536)
      	at io.debezium.connector.mysql.MySqlDdlParser.parseCreateTable(MySqlDdlParser.java:353)
      	at io.debezium.connector.mysql.MySqlDdlParser.parseCreate(MySqlDdlParser.java:259)
      	at io.debezium.connector.mysql.MySqlDdlParser.parseNextStatement(MySqlDdlParser.java:134)
      	at io.debezium.relational.ddl.DdlParser.parse(DdlParser.java:285)
      	at io.debezium.relational.ddl.DdlParser.parse(DdlParser.java:266)
      	at io.debezium.connector.mysql.MySqlSchema.applyDdl(MySqlSchema.java:331)
      	at io.debezium.connector.mysql.BinlogReader.handleQueryEvent(BinlogReader.java:423)
      	at io.debezium.connector.mysql.BinlogReader.handleEvent(BinlogReader.java:296)
      	at com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:877)
      	at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:735)
      	at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:451)
      	at com.github.shyiko.mysql.binlog.BinaryLogClient$5.run(BinaryLogClient.java:632)
      	at java.lang.Thread.run(Thread.java:745)
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                rhauch Randall Hauch
                Reporter:
                renwu58 RenZhu Zhang
              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: