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

Getting "Unknown column in 'field list'" when column name contains backtick

XMLWordPrintable

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

      Bug report

      When the field name contains a backtick, the MySQL connector will fail to run during snapshot.

      What Debezium connector do you use and what version?

      mysql connector and mariadb connector, 3.3.0.

      What is the connector configuration?

      <Your answer>

      What is the captured database version and mode of deployment?

      mysql and mariadb, all version.

       

      What behavior do you expect?

      <Your answer>

      What behavior do you see?

      <Your answer>

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

      Yes.

       

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

      Caused by: java.sql.SQLSyntaxErrorException: Unknown column 'COUNT(``id``)' in 'field list'
      at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:112)
      at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:114)
      at com.mysql.cj.jdbc.StatementImpl.executeQuery(StatementImpl.java:1312)
      at io.debezium.relational.RelationalSnapshotChangeEventSource.resultSetForDataEvents(RelationalSnapshotChangeEventSource.java:673)
      at io.debezium.relational.RelationalSnapshotChangeEventSource.doCreateDataEventsForTable(RelationalSnapshotChangeEventSource.java:622)
      at io.debezium.relational.RelationalSnapshotChangeEventSource.lambda$createDataEventsForTableCallable$6(RelationalSnapshotChangeEventSource.java:583)

       

      How to reproduce the issue using our tutorial deployment?

      CREATE TABLE `t1` (

      `COUNT(``id``)` bigint NOT NULL AUTO_INCREMENT,

      `COUNT(````age````)` bigint NOT NULL DEFAULT '0',

      `COUNT(``````name``````)` varchar(32) DEFAULT NULL,

      PRIMARY KEY (`COUNT(``id``)`) USING BTREE,

      UNIQUE KEY `idx_age` (`COUNT(````age````)`) USING BTREE

      ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=COMPACT;

      Feature request or enhancement

      For feature requests or enhancements, provide this information, please:

      Which use case/requirement will be addressed by the proposed feature?

      <Your answer>

      Implementation ideas (optional)

      <Your answer>

              Unassigned Unassigned
              leoloel xing Leo
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: