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

CHARSET is not supported for CAST function

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 0.10.0.Beta3
    • 0.9.5.Final, 0.10.0.Beta2
    • mysql-connector
    • None

      I believe this sanitized create table is the problem:

      CREATE TABLE `table_name` (  
      `column_name_uuid` binary(16) GENERATED ALWAYS AS (cast(unhex(replace(json_unquote(json_extract(`column_name`,'$.id')),'-','')) as char(16) charset binary)) VIRTUAL
      )
      

      Stack:

       `column_name` binary(16) GENERATED ALWAYS AS (cast(unhex(replace(json_unquote(json_extract(`column_name`,'$.id')),'-','')) as char(16) charset'
      	at io.debezium.antlr.ParsingErrorListener.syntaxError(ParsingErrorListener.java:40) ~[debezium-ddl-parser-0.9.5.Final.jar:0.9.5.Final]
      	at org.antlr.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:41) ~[antlr4-runtime-4.7.jar:4.7]
      	at org.antlr.v4.runtime.Parser.notifyErrorListeners(Parser.java:544) ~[antlr4-runtime-4.7.jar:4.7]
      	at org.antlr.v4.runtime.DefaultErrorStrategy.reportNoViableAlternative(DefaultErrorStrategy.java:282) ~[antlr4-runtime-4.7.jar:4.7]
      	at org.antlr.v4.runtime.DefaultErrorStrategy.reportError(DefaultErrorStrategy.java:121) ~[antlr4-runtime-4.7.jar:4.7]
      	at io.debezium.ddl.parser.mysql.generated.MySqlParser.sqlStatements(MySqlParser.java:1078) ~[debezium-ddl-parser-0.9.5.Final.jar:0.9.5.Final]
      	at io.debezium.ddl.parser.mysql.generated.MySqlParser.root(MySqlParser.java:812) ~[debezium-ddl-parser-0.9.5.Final.jar:0.9.5.Final]
      	at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.parseTree(MySqlAntlrDdlParser.java:68) ~[debezium-connector-mysql-0.9.5.Final.jar:0.9.5.Final]
      	at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.parseTree(MySqlAntlrDdlParser.java:41) ~[debezium-connector-mysql-0.9.5.Final.jar:0.9.5.Final]
      	at io.debezium.antlr.AntlrDdlParser.parse(AntlrDdlParser.java:80) ~[debezium-ddl-parser-0.9.5.Final.jar:0.9.5.Final]
      	at io.debezium.relational.history.AbstractDatabaseHistory.lambda$recover$1(AbstractDatabaseHistory.java:104) ~[debezium-core-0.9.5.Final.jar:0.9.5.Final]
      	at com.possiblefinance.data.DynamoDBDatabaseHistory.lambda$recoverRecords$1(DynamoDBDatabaseHistory.java:103) ~[classes/:na]
      	at io.debezium.util.FunctionalReadWriteLock.write(FunctionalReadWriteLock.java:96) ~[debezium-core-0.9.5.Final.jar:0.9.5.Final]
      	at com.possiblefinance.data.DynamoDBDatabaseHistory.recoverRecords(DynamoDBDatabaseHistory.java:97) ~[classes/:na]
      	at io.debezium.relational.history.AbstractDatabaseHistory.recover(AbstractDatabaseHistory.java:73) ~[debezium-core-0.9.5.Final.jar:0.9.5.Final]
      	at io.debezium.connector.mysql.MySqlSchema.loadHistory(MySqlSchema.java:252) ~[debezium-connector-mysql-0.9.5.Final.jar:0.9.5.Final]
      	at io.debezium.connector.mysql.MySqlTaskContext.loadHistory(MySqlTaskContext.java:165) ~[debezium-connector-mysql-0.9.5.Final.jar:0.9.5.Final]
      	at io.debezium.connector.mysql.MySqlConnectorTask.start(MySqlConnectorTask.java:105) ~[debezium-connector-mysql-0.9.5.Final.jar:0.9.5.Final]
      	at io.debezium.connector.common.BaseSourceTask.start(BaseSourceTask.java:49) ~[debezium-core-0.9.5.Final.jar:0.9.5.Final]
      	at io.debezium.embedded.EmbeddedEngine.run(EmbeddedEngine.java:791) ~[debezium-embedded-0.9.5.Final.jar:0.9.5.Final]
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[na:na]
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[na:na]
      	at java.base/java.lang.Thread.run(Unknown Source) ~[na:na]
      	Caused by: org.antlr.v4.runtime.NoViableAltException: null
      	at org.antlr.v4.runtime.atn.ParserATNSimulator.noViableAlt(ParserATNSimulator.java:2023) ~[antlr4-runtime-4.7.jar:4.7]
      	at org.antlr.v4.runtime.atn.ParserATNSimulator.execATN(ParserATNSimulator.java:467) ~[antlr4-runtime-4.7.jar:4.7]
      	at org.antlr.v4.runtime.atn.ParserATNSimulator.adaptivePredict(ParserATNSimulator.java:393) ~[antlr4-runtime-4.7.jar:4.7]
      	at io.debezium.ddl.parser.mysql.generated.MySqlParser.sqlStatements(MySqlParser.java:886) ~[debezium-ddl-parser-0.9.5.Final.jar:0.9.5.Final]
      	... 17 common frames omitted

              jpechane Jiri Pechanec
              theatomicpunk Cott Lang (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: