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

Cannot parse expression in DEFAULT column definition

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.5.0.Alpha1
    • 1.3.0.Final
    • mysql-connector
    • None
    • False
    • False
    • Undefined
    • Hide

      The DDL statement which triggered the error:
      create table if not exists rack_shelf_bin (
        id int unsigned not null auto_increment unique primary key,
        rack_shelf_id int unsigned not null,
        bin_seq tinyint unsigned not null,
        bin_len decimal(12, 4) not null check(bin_len > 0),
        bin_width decimal(12, 4) not null check(bin_width > 0),
        bin_height decimal(12, 4) not null check(bin_height > 0),
        bin_volume decimal(20, 4) default (bin_len * bin_width * bin_height),
        max_sku_allowed tinyint unsigned not null,
        constraint rack_shelf_bin_unique unique (rack_shelf_id, bin_seq),
        constraint fk_rack_shelf foreign key (rack_shelf_id) references rack_shelf(id)
      );

      Show
      The DDL statement which triggered the error: create table if not exists rack_shelf_bin (   id int unsigned not null auto_increment unique primary key,   rack_shelf_id int unsigned not null,   bin_seq tinyint unsigned not null,   bin_len decimal(12, 4) not null check(bin_len > 0),   bin_width decimal(12, 4) not null check(bin_width > 0),   bin_height decimal(12, 4) not null check(bin_height > 0),   bin_volume decimal(20, 4) default (bin_len * bin_width * bin_height),   max_sku_allowed tinyint unsigned not null,   constraint rack_shelf_bin_unique unique (rack_shelf_id, bin_seq),   constraint fk_rack_shelf foreign key (rack_shelf_id) references rack_shelf(id) );

      I'm getting the below error:
      *org.apache.kafka.connect.errors.ConnectException: no viable alternative at input 'create table if not exists rack_shelf_bin (
      n  id int unsigned not null auto_increment unique primary key,
      n  rack_shelf_id int unsigned not null,
      n  bin_seq tinyint unsigned not null,
      n  bin_len decimal(12, 4) not null check(bin_len > 0),
      n  bin_width decimal(12, 4) not null check(bin_width > 0),
      n  bin_height decimal(12, 4) not null check(bin_height > 0),
      n  bin_volume decimal(20, 4) default ('\n\tat io.debezium.connector.mysql.AbstractReader.wrap(AbstractReader.java:230)\n\tat io.debezium.connector.mysql.AbstractReader.failed(AbstractReader.java:207)\n\tat io.debezium.connector.mysql.BinlogReader.handleEvent(BinlogReader.java:604)\n\tat com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1100)\n\tat com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:951)\n\tat com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:594)\n\tat com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:838)\n\tat java.lang.Thread.run(Thread.java:748)\nCaused by: io.debezium.text.ParsingException: no viable alternative at input 'create table if not exists rack_shelf_bin (
      n  id int unsigned not null auto_increment unique primary key,
      n  rack_shelf_id int unsigned not null,
      n  bin_seq tinyint unsigned not null,
      n  bin_len decimal(12, 4) not null check(bin_len > 0),
      n  bin_width decimal(12, 4) not null check(bin_width > 0),
      n  bin_height decimal(12, 4) not null check(bin_height > 0),
      n  bin_volume decimal(20, 4) default ('\n\tat io.debezium.antlr.ParsingErrorListener.syntaxError(ParsingErrorListener.java:40)\n\tat org.antlr.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:41)\n\tat org.antlr.v4.runtime.Parser.notifyErrorListeners(Parser.java:544)\n\tat org.antlr.v4.runtime.DefaultErrorStrategy.reportNoViableAlternative(DefaultErrorStrategy.java:310)\n\tat org.antlr.v4.runtime.DefaultErrorStrategy.reportError(DefaultErrorStrategy.java:136)\n\tat io.debezium.ddl.parser.mysql.generated.MySqlParser.sqlStatements(MySqlParser.java:1148)\n\tat io.debezium.ddl.parser.mysql.generated.MySqlParser.root(MySqlParser.java:876)\n\tat io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.parseTree(MySqlAntlrDdlParser.java:68)\n\tat io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.parseTree(MySqlAntlrDdlParser.java:41)\n\tat io.debezium.antlr.AntlrDdlParser.parse(AntlrDdlParser.java:80)\n\tat io.debezium.connector.mysql.MySqlSchema.applyDdl(MySqlSchema.java:314)\n\tat io.debezium.connector.mysql.BinlogReader.handleQueryEvent(BinlogReader.java:797)\n\tat io.debezium.connector.mysql.BinlogReader.handleEvent(BinlogReader.java:587)\n\t... 5 more\nCaused by: org.antlr.v4.runtime.NoViableAltException\n\tat org.antlr.v4.runtime.atn.ParserATNSimulator.noViableAlt(ParserATNSimulator.java:2026)\n\tat org.antlr.v4.runtime.atn.ParserATNSimulator.execATN(ParserATNSimulator.java:467)\n\tat org.antlr.v4.runtime.atn.ParserATNSimulator.adaptivePredict(ParserATNSimulator.java:393)\n\tat io.debezium.ddl.parser.mysql.generated.MySqlParser.sqlStatements(MySqlParser.java:950)\n\t... 12 more*
       
       
       

              Unassigned Unassigned
              midhuns Midhun Sukumaran (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: