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

'CREATE TABLE t (c NATIONAL CHAR)' parsing failed

    XMLWordPrintable

Details

    • False
    • None
    • False
    • Important

    Description

      Bug report

       

      The parsing of DDL 'CREATE TABLE t (c NATIONAL CHAR)' failed for the internal NullPointerException.

      What Debezium connector do you use and what version?

      debezium-connector-mysql:2.2.0.CR1

      What is the connector configuration?

      props.put("name", "abc");
      props.put("connector.class", "io.debezium.connector.mysql.MySqlConnector");
      props.put("database.hostname", "127.0.0.1");
      props.put("database.port", "53306");
      props.put("database.user", "root");
      props.put("database.password", "password");
      props.put("database.server.id", "100000");
      props.put("database.server.name", "abc");
      props.put("database.allowPublicKeyRetrieval", "true");

      What is the captured database version and mode of depoyment?

      On-prem, 8.0.30 MySQL Community Server

      What behaviour do you expect?

      SQL should be parsed as expected.

      What behaviour do you see?

      Internal NullPointerException was thrown and the replication stopped.

      Do you see the same behaviour using the latest relesead Debezium version?

      The version I used was the latest one.

      Do you have the connector logs, ideally from start till finish?

      11:16:31.528 [blc-127.0.0.1:53306] DEBUG io.debezium.connector.mysql.MySqlStreamingChangeEventSource - Received query command: Event{header=EventHeaderV4{timestamp=1681874191000, eventType=QUERY, serverId=1, headerLength=19, dataLength=119, nextPosition=875, flags=0}, data=QueryEventData{threadId=9, executionTime=0, errorCode=0, database='test_charset', sql='create table ttt (c NATIONAL CHAR)'}}
      11:16:31.528 [blc-127.0.0.1:53306] DEBUG io.debezium.connector.mysql.MySqlDatabaseSchema - Processing streaming DDL 'create table ttt (c NATIONAL CHAR)' for database 'test_charset'
      11:16:31.539 [blc-127.0.0.1:53306] ERROR io.debezium.connector.mysql.MySqlStreamingChangeEventSource - Error during binlog processing. Last offset stored = {transaction_id=null, file=binlog.000008, pos=737, server_id=1, event=1}, binlog reader near position = binlog.000008/737
      11:16:31.542 [blc-127.0.0.1:53306] ERROR io.debezium.pipeline.ErrorHandler - Producer failure
      io.debezium.DebeziumException: Error processing binlog event
          at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleEvent(MySqlStreamingChangeEventSource.java:392)
          at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.lambda$execute$27(MySqlStreamingChangeEventSource.java:922)
          at com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1246)
          at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:1072)
          at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:631)
          at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:932)
          at java.base/java.lang.Thread.run(Thread.java:833)
      Caused by: java.lang.NullPointerException: Cannot invoke "io.debezium.connector.mysql.antlr.listener.DefaultValueParserListener.exitDefaultValue(boolean)" because "this.defaultValueListener" is null
          at io.debezium.connector.mysql.antlr.listener.ColumnDefinitionParserListener.lambda$exitColumnDefinition$1(ColumnDefinitionParserListener.java:94)
          at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.runIfNotNull(MySqlAntlrDdlParser.java:409)
          at io.debezium.connector.mysql.antlr.listener.ColumnDefinitionParserListener.exitColumnDefinition(ColumnDefinitionParserListener.java:93)
          at io.debezium.ddl.parser.mysql.generated.MySqlParser$ColumnDefinitionContext.exitRule(MySqlParser.java:8860)
          at io.debezium.antlr.ProxyParseTreeListenerUtil.delegateExitRule(ProxyParseTreeListenerUtil.java:64)
          at io.debezium.connector.mysql.antlr.listener.MySqlAntlrDdlParserListener.exitEveryRule(MySqlAntlrDdlParserListener.java:106)
          at org.antlr.v4.runtime.tree.ParseTreeWalker.exitRule(ParseTreeWalker.java:63)
          at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:38)
          at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
          at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
          at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
          at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
          at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
          at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
          at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
          at io.debezium.antlr.AntlrDdlParser.parse(AntlrDdlParser.java:83)
          at io.debezium.connector.mysql.MySqlDatabaseSchema.parseDdl(MySqlDatabaseSchema.java:213)
          at io.debezium.connector.mysql.MySqlDatabaseSchema.parseStreamingDdl(MySqlDatabaseSchema.java:199)
          at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleQueryEvent(MySqlStreamingChangeEventSource.java:590)
          at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.lambda$execute$15(MySqlStreamingChangeEventSource.java:893)
          at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleEvent(MySqlStreamingChangeEventSource.java:372)
          ... 6 common frames omitted
      11:16:31.543 [blc-127.0.0.1:53306] INFO io.debezium.connector.mysql.MySqlStreamingChangeEventSource - Error processing binlog event, and propagating to Kafka Connect so it stops this connector. Future binlog events read before connector is shutdown will be ignored.
      11:16:31.701 [pool-8-thread-1] DEBUG io.debezium.connector.base.ChangeEventQueue - checking for more records...
      11:16:31.701 [pool-8-thread-1] DEBUG io.debezium.embedded.EmbeddedEngine - Embedded engine returned from polling task for records
      11:16:31.701 [pool-8-thread-1] DEBUG io.debezium.embedded.EmbeddedEngine - Received no records from the task
      11:16:31.701 [pool-8-thread-1] DEBUG io.debezium.embedded.EmbeddedEngine - Embedded engine is polling task for records on thread Thread[pool-8-thread-1,5,main]
      11:16:31.701 [pool-8-thread-1] DEBUG io.debezium.connector.base.ChangeEventQueue - polling records...
      11:16:31.701 [pool-8-thread-1] INFO io.debezium.embedded.EmbeddedEngine - Stopping the task and engine
      11:16:31.701 [pool-8-thread-1] INFO io.debezium.connector.common.BaseSourceTask - Stopping down connector
      4月 19, 2023 11:16:31 上午 com.github.shyiko.mysql.binlog.BinaryLogClient$5 run
      信息: threadExecutor is shut down, terminating keepalive thread
      11:16:31.765 [blc-127.0.0.1:53306] INFO io.debezium.connector.mysql.MySqlStreamingChangeEventSource - Stopped reading binlog after 0 events, last recorded offset: {transaction_id=null, file=binlog.000008, pos=737, server_id=1, event=1}
      11:16:31.765 [debezium-mysqlconnector-MyConn2-change-event-source-coordinator] INFO io.debezium.pipeline.ChangeEventSourceCoordinator - Finished streaming
      11:16:31.768 [pool-11-thread-1] INFO io.debezium.jdbc.JdbcConnection - Connection gracefully closed
      11:16:31.769 [pool-8-thread-1] DEBUG io.debezium.connector.common.BaseSourceTask - Setting task state to 'STOPPED', previous state was 'RUNNING'
      11:16:31.770 [pool-8-thread-1] INFO com.foxlake.debezium.S3OffsetBackingStore - Stopped S3OffsetBackingStore
      11:16:31.770 [pool-8-thread-1] ERROR io.debezium.embedded.EmbeddedEngine - Error while trying to run connector class 'io.debezium.connector.mysql.MySqlConnector'
      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:72)
          at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleEvent(MySqlStreamingChangeEventSource.java:392)
          at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.lambda$execute$27(MySqlStreamingChangeEventSource.java:922)
          at com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1246)
          at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:1072)
          at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:631)
          at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:932)
          at java.base/java.lang.Thread.run(Thread.java:833)
      Caused by: io.debezium.DebeziumException: Error processing binlog event
          ... 7 common frames omitted
      Caused by: java.lang.NullPointerException: Cannot invoke "io.debezium.connector.mysql.antlr.listener.DefaultValueParserListener.exitDefaultValue(boolean)" because "this.defaultValueListener" is null
          at io.debezium.connector.mysql.antlr.listener.ColumnDefinitionParserListener.lambda$exitColumnDefinition$1(ColumnDefinitionParserListener.java:94)
          at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.runIfNotNull(MySqlAntlrDdlParser.java:409)
          at io.debezium.connector.mysql.antlr.listener.ColumnDefinitionParserListener.exitColumnDefinition(ColumnDefinitionParserListener.java:93)
          at io.debezium.ddl.parser.mysql.generated.MySqlParser$ColumnDefinitionContext.exitRule(MySqlParser.java:8860)
          at io.debezium.antlr.ProxyParseTreeListenerUtil.delegateExitRule(ProxyParseTreeListenerUtil.java:64)
          at io.debezium.connector.mysql.antlr.listener.MySqlAntlrDdlParserListener.exitEveryRule(MySqlAntlrDdlParserListener.java:106)
          at org.antlr.v4.runtime.tree.ParseTreeWalker.exitRule(ParseTreeWalker.java:63)
          at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:38)
          at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
          at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
          at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
          at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
          at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
          at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
          at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
          at io.debezium.antlr.AntlrDdlParser.parse(AntlrDdlParser.java:83)
          at io.debezium.connector.mysql.MySqlDatabaseSchema.parseDdl(MySqlDatabaseSchema.java:213)
          at io.debezium.connector.mysql.MySqlDatabaseSchema.parseStreamingDdl(MySqlDatabaseSchema.java:199)
          at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleQueryEvent(MySqlStreamingChangeEventSource.java:590)
          at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.lambda$execute$15(MySqlStreamingChangeEventSource.java:893)
          at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleEvent(MySqlStreamingChangeEventSource.java:372)
          ... 6 common frames omitted

      How to reproduce the issue using our tutorial deployment?

      Just execute the SQL 'CREATE TABLE t (c NATIONAL CHAR)' and start a replication procedure on Debezium.

      Attachments

        Issue Links

          Activity

            People

              anmohant Anisha Mohanty
              vwagen Wu Xiang
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: