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

Mysql CREATE USER with DEFAULT fails with parsing exception

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • None
    • mysql-connector
    • None
    • False
    • None
    • False

      In order to make your issue reports as actionable as possible, please provide the following information, depending on the issue type.

      Bug report

      For bug reports, provide this information, please:

      What Debezium connector do you use and what version?

      Debezium Mysql for Kafka connect

      Version: 1.9.7.aiven

      What is the connector configuration?

      Sensitive info has been redacted. 

      ----------
      "name"            = "${local.connector_name}"
      "connector.class" = "io.debezium.connector.mysql.MySqlConnector",
      "tasks.max"       = 1,
      
      "database.hostname"    = "",
      "database.port"        = ,
      "database.user"        = "",
      "database.password"    = ,
      "database.server.id"   = ,
      "database.server.name" = "",
      "database.ssl.mode"    = "",
      
      "key.converter"                  = "org.apache.kafka.connect.json.JsonConverter",
      "key.converter.schemas.enable"   = false,
      "value.converter"                = "org.apache.kafka.connect.json.JsonConverter",
      "value.converter.schemas.enable" = false,
      
      "database.history.kafka.bootstrap.servers" = "${aiven_kafka.kafkacluster.service_uri}"
      "database.history.kafka.topic"             = "schemahistory.cdc",
      "include.schema.changes"                   = true,
      
      "decimal.handling.mode" = "double",
      
      "table.include.list"     = "",
      "signal.data.collection" = "",
      
      "snapshot.mode"         = "when_needed",
      "snapshot.locking.mode" = "none",
      "snapshot.fetch.size"   = 5000,
      
      "provide.transaction.metadata" = true,
      
      "topic.prefix"                              = "cdc",
      "topic.creation.default.cleanup.policy"     = "compact",
      "topic.creation.default.partitions"         = 3,
      "topic.creation.default.replication.factor" = 2,
      "topic.creation.default.compression.type"   = "lz4",
      "topic.creation.groups"                     = "dbz",
      "topic.creation.dbz.partitions"             = 1,
      "topic.creation.dbz.include"                = "",
      "topic.creation.dbz.cleanup.policy"         = "delete",
      "topic.creation.dbz.delete.retention.ms"    = 7776000000,
      
      "database.history.producer.security.protocol"       = "",
      "database.history.producer.ssl.keystore.type"       = "",
      "database.history.producer.ssl.keystore.location"   = "",
      "database.history.producer.ssl.keystore.password"   = "",
      "database.history.producer.ssl.truststore.location" = "",
      "database.history.producer.ssl.truststore.password" = "",
      "database.history.producer.ssl.key.password"        = "",
      
      "database.history.consumer.security.protocol"       = "",
      "database.history.consumer.ssl.keystore.type"       = "",
      "database.history.consumer.ssl.keystore.location"   = "",
      "database.history.consumer.ssl.keystore.password"   = "",
      "database.history.consumer.ssl.truststore.location" = "",
      "database.history.consumer.ssl.truststore.password" = "",
      "database.history.consumer.ssl.key.password"        = "",
      
      "database.history.store.only.captured.tables.ddl" = true
      "database.history.skip.unparseable.ddl"           = true
      
      "_aiven.restart.on.failure" = true
      ---------- 

      What is the captured database version and mode of depoyment?

      The source is MySQL 8.0.30 hosted in Google CloudSQL managed service.

      What behaviour do you expect?

      Successful parsing of Mysql statements. 

      What behaviour do you see?

      Connector throws parsing error, advising we open a Jira here. 

      [2023-07-03 05:16:15,567] WARN [ctr-cdc-us-east1-kafka-tf-01|task-0] Ignoring unparseable DDL statement 'CREATE USER IF NOT EXISTS 'REDACTED'@'cloudsqlproxy~%' IDENTIFIED WITH 'mysql_native_password' AS 'REDACTED' DEFAULT ROLE `role_app_reader`@`%`': {} (io.debezium.connector.mysql.MySqlDatabaseSchema:228) io.debezium.text.ParsingException: DDL statement couldn't be parsed. Please open a Jira issue with the statement 'CREATE USER IF NOT EXISTS 'REDACTED'@'cloudsqlproxy~%' IDENTIFIED WITH 'mysql_native_password' AS 'REDACTED' DEFAULT ROLE `role_app_reader`@`%`' mismatched input 'DEFAULT' expecting {<EOF>, '-'} 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.reportInputMismatch(DefaultErrorStrategy.java:327) at org.antlr.v4.runtime.DefaultErrorStrategy.reportError(DefaultErrorStrategy.java:139) at io.debezium.ddl.parser.mysql.generated.MySqlParser.root(MySqlParser.java:972) at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.parseTree(MySqlAntlrDdlParser.java:73) 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:224) at io.debezium.connector.mysql.MySqlDatabaseSchema.parseStreamingDdl(MySqlDatabaseSchema.java:210) at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleQueryEvent(MySqlStreamingChangeEventSource.java:571) at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.lambda$execute$14(MySqlStreamingChangeEventSource.java:846) at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleEvent(MySqlStreamingChangeEventSource.java:354) at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.lambda$execute$25(MySqlStreamingChangeEventSource.java:874) 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: org.antlr.v4.runtime.InputMismatchException at org.antlr.v4.runtime.DefaultErrorStrategy.sync(DefaultErrorStrategy.java:270) at io.debezium.ddl.parser.mysql.generated.MySqlParser.root(MySqlParser.java:955) ... 14 more 

      Normally, this would cause connector to crash, but is currently being ignored due to workaround being in place. 

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

      Still have issue on latest version in the context of Aiven platform. 

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

      Stack trace is extent of info we have. 

      How to reproduce the issue using our tutorial deployment?

      Run debezium connector on mysql and process statement that includes RETAIN CURRENT PASSWORD. This leads to a parsing error. 

      Current workaround is setting "database.history.skip.unparseable.ddl"           = true in the config. Setting this to false will result in connector stopping when hitting these errors. 

       

      Please let us know if you need additional info on this report. 

              Unassigned Unassigned
              josh.martin.aiven Josh Martin (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: