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

[MySQL Debezium] DDL Parsing error - curdate() & cast()

    XMLWordPrintable

Details

    Description

      MySQL debezium version: 1.7.2 & 1.8.0
       
      I got an parsing error when i created table with 'default curdate()' or 'DEFAULT cast(current_timestamp() as date)'
       
       
      The error is below ---------------------------------------------------

      [2022-01-03 10:33:05,295] ERROR [dbz-mariadb_t3|task-0] Producer failure (io.debezium.pipeline.ErrorHandler:31)
      io.debezium.DebeziumException: io.debezium.text.ParsingException: DDL statement couldn't be parsed. Please open a Jira issue with the statement 'CREATE TABLE `t_test_curdate` (
        `id` int(11) NOT NULL AUTO_INCREMENT,
        `c1` datetime NOT NULL DEFAULT curdate() COMMENT 'error test',
        PRIMARY KEY (`id`)
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4'
      no viable alternative at input 'CREATE TABLE `t_test_curdate` (\n  `id` int(11) NOT NULL AUTO_INCREMENT,\n  `c1` datetime NOT NULL DEFAULT curdate'
              at io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.execute(AbstractSnapshotChangeEventSource.java:79)
              at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:118)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
              at java.lang.Thread.run(Thread.java:748)
      Caused by: io.debezium.text.ParsingException: DDL statement couldn't be parsed. Please open a Jira issue with the statement 'CREATE TABLE `t_test_curdate` (
        `id` int(11) NOT NULL AUTO_INCREMENT,
        `c1` datetime NOT NULL DEFAULT curdate() COMMENT 'error test',
        PRIMARY KEY (`id`)
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4'
      no viable alternative at input 'CREATE TABLE `t_test_curdate` (\n  `id` int(11) NOT NULL AUTO_INCREMENT,\n  `c1` datetime NOT NULL DEFAULT curdate'
              at io.debezium.antlr.ParsingErrorListener.syntaxError(ParsingErrorListener.java:43)
              at org.antlr.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:41)
              at org.antlr.v4.runtime.Parser.notifyErrorListeners(Parser.java:544)
              at org.antlr.v4.runtime.DefaultErrorStrategy.reportNoViableAlternative(DefaultErrorStrategy.java:310)
              at org.antlr.v4.runtime.DefaultErrorStrategy.reportError(DefaultErrorStrategy.java:136)
              at io.debezium.ddl.parser.mysql.generated.MySqlParser.sqlStatements(MySqlParser.java:1194)
              at io.debezium.ddl.parser.mysql.generated.MySqlParser.root(MySqlParser.java:922)
              at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.parseTree(MySqlAntlrDdlParser.java:72)
              at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.parseTree(MySqlAntlrDdlParser.java:45)
              at io.debezium.antlr.AntlrDdlParser.parse(AntlrDdlParser.java:82)
              at io.debezium.connector.mysql.MySqlDatabaseSchema.parseDdl(MySqlDatabaseSchema.java:216)
              at io.debezium.connector.mysql.MySqlDatabaseSchema.parseSnapshotDdl(MySqlDatabaseSchema.java:196)
              at io.debezium.connector.mysql.MySqlSnapshotChangeEventSource.addSchemaEvent(MySqlSnapshotChangeEventSource.java:303)
              at io.debezium.connector.mysql.MySqlSnapshotChangeEventSource.lambda$createSchemaEventsForTables$5(MySqlSnapshotChangeEventSource.java:373)
              at io.debezium.jdbc.JdbcConnection.query(JdbcConnection.java:558)
              at io.debezium.jdbc.JdbcConnection.query(JdbcConnection.java:499)
              at io.debezium.connector.mysql.MySqlSnapshotChangeEventSource.createSchemaEventsForTables(MySqlSnapshotChangeEventSource.java:371)
              at io.debezium.connector.mysql.MySqlSnapshotChangeEventSource.readTableStructure(MySqlSnapshotChangeEventSource.java:360)
              at io.debezium.connector.mysql.MySqlSnapshotChangeEventSource.readTableStructure(MySqlSnapshotChangeEventSource.java:47)
              at io.debezium.relational.RelationalSnapshotChangeEventSource.doExecute(RelationalSnapshotChangeEventSource.java:119)
              at io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.execute(AbstractSnapshotChangeEventSource.java:70)
              ... 6 more
      Caused by: org.antlr.v4.runtime.NoViableAltException
              at org.antlr.v4.runtime.atn.ParserATNSimulator.noViableAlt(ParserATNSimulator.java:2026)
              at org.antlr.v4.runtime.atn.ParserATNSimulator.execATN(ParserATNSimulator.java:467)
              at org.antlr.v4.runtime.atn.ParserATNSimulator.adaptivePredict(ParserATNSimulator.java:393)
              at io.debezium.ddl.parser.mysql.generated.MySqlParser.sqlStatements(MySqlParser.java:996)
              ... 21 more
      [2022-01-03 10:33:05,444] INFO [dbz-mariadb_t3|task-0] WorkerSourceTask\{id=dbz-mariadb_t3-0} flushing 0 outstanding messages for offset commit (org.apache.kafka.connect.runtime.WorkerSourceTask:487)
      [2022-01-03 10:33:05,444] ERROR [dbz-mariadb_t3|task-0] WorkerSourceTask\{id=dbz-mariadb_t3-0} Task threw an uncaught and unrecoverable exception. Task is being killed and will not recover until manually restarted (org.apache.kafka.connect.runtime.WorkerTask:184)
      org.apache.kafka.connect.errors.ConnectException: An exception occurred in the change event producer. This connector will be stopped.
              at io.debezium.pipeline.ErrorHandler.setProducerThrowable(ErrorHandler.java:42)
              at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:135)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
              at java.lang.Thread.run(Thread.java:748)
      Caused by: io.debezium.DebeziumException: io.debezium.text.ParsingException: DDL statement couldn't be parsed. Please open a Jira issue with the statement 'CREATE TABLE `t_test_curdate` (
        `id` int(11) NOT NULL AUTO_INCREMENT,
        `c1` datetime NOT NULL DEFAULT curdate() COMMENT 'error test',
        PRIMARY KEY (`id`)
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4'
      no viable alternative at input 'CREATE TABLE `t_test_curdate` (\n  `id` int(11) NOT NULL AUTO_INCREMENT,\n  `c1` datetime NOT NULL DEFAULT curdate'
              at io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.execute(AbstractSnapshotChangeEventSource.java:79)
              at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:118)
              ... 5 more
      Caused by: io.debezium.text.ParsingException: DDL statement couldn't be parsed. Please open a Jira issue with the statement 'CREATE TABLE `t_test_curdate` (
        `id` int(11) NOT NULL AUTO_INCREMENT,
        `c1` datetime NOT NULL DEFAULT curdate() COMMENT 'error test',
        PRIMARY KEY (`id`)
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4'
      no viable alternative at input 'CREATE TABLE `t_test_curdate` (\n  `id` int(11) NOT NULL AUTO_INCREMENT,\n  `c1` datetime NOT NULL DEFAULT curdate'
              at io.debezium.antlr.ParsingErrorListener.syntaxError(ParsingErrorListener.java:43)
              at org.antlr.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:41)
              at org.antlr.v4.runtime.Parser.notifyErrorListeners(Parser.java:544)
              at org.antlr.v4.runtime.DefaultErrorStrategy.reportNoViableAlternative(DefaultErrorStrategy.java:310)
              at org.antlr.v4.runtime.DefaultErrorStrategy.reportError(DefaultErrorStrategy.java:136)
              at io.debezium.ddl.parser.mysql.generated.MySqlParser.sqlStatements(MySqlParser.java:1194)
              at io.debezium.ddl.parser.mysql.generated.MySqlParser.root(MySqlParser.java:922)
              at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.parseTree(MySqlAntlrDdlParser.java:72)
              at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.parseTree(MySqlAntlrDdlParser.java:45)
              at io.debezium.antlr.AntlrDdlParser.parse(AntlrDdlParser.java:82)
              at io.debezium.connector.mysql.MySqlDatabaseSchema.parseDdl(MySqlDatabaseSchema.java:216)
              at io.debezium.connector.mysql.MySqlDatabaseSchema.parseSnapshotDdl(MySqlDatabaseSchema.java:196)
              at io.debezium.connector.mysql.MySqlSnapshotChangeEventSource.addSchemaEvent(MySqlSnapshotChangeEventSource.java:303)
              at io.debezium.connector.mysql.MySqlSnapshotChangeEventSource.lambda$createSchemaEventsForTables$5(MySqlSnapshotChangeEventSource.java:373)
              at io.debezium.jdbc.JdbcConnection.query(JdbcConnection.java:558)
              at io.debezium.jdbc.JdbcConnection.query(JdbcConnection.java:499)
              at io.debezium.connector.mysql.MySqlSnapshotChangeEventSource.createSchemaEventsForTables(MySqlSnapshotChangeEventSource.java:371)
              at io.debezium.connector.mysql.MySqlSnapshotChangeEventSource.readTableStructure(MySqlSnapshotChangeEventSource.java:360)
              at io.debezium.connector.mysql.MySqlSnapshotChangeEventSource.readTableStructure(MySqlSnapshotChangeEventSource.java:47)
              at io.debezium.relational.RelationalSnapshotChangeEventSource.doExecute(RelationalSnapshotChangeEventSource.java:119)
              at io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.execute(AbstractSnapshotChangeEventSource.java:70)
              ... 6 more
      Caused by: org.antlr.v4.runtime.NoViableAltException
              at org.antlr.v4.runtime.atn.ParserATNSimulator.noViableAlt(ParserATNSimulator.java:2026)
              at org.antlr.v4.runtime.atn.ParserATNSimulator.execATN(ParserATNSimulator.java:467)
              at org.antlr.v4.runtime.atn.ParserATNSimulator.adaptivePredict(ParserATNSimulator.java:393)
              at io.debezium.ddl.parser.mysql.generated.MySqlParser.sqlStatements(MySqlParser.java:996)
              ... 21 more
      [2022-01-03 10:33:05,445] INFO [dbz-mariadb_t3|task-0] Stopping down connector (io.debezium.connector.common.BaseSourceTask:241)
      

      Attachments

        Activity

          People

            anmohant Anisha Mohanty
            chu1070y@naver.com Steven Chu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: