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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • 0.3.6, 0.4
    • 0.3.5
    • mysql-connector
    • None
    • 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) );

      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)
      

              rhauch Randall Hauch (Inactive)
              renwu58_jira RenZhu Zhang (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: