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

Antlr parser raising exception when parsing ENUM fields

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 0.8.0.CR1
    • 0.8.0.Beta1
    • mysql-connector
    • None
    • Hide

      Create a table with a required ENUM field.
      Add/Update a row in that table, making certain the ENUM field is populated.

      Show
      Create a table with a required ENUM field. Add/Update a row in that table, making certain the ENUM field is populated.

    Description

      We are encountering an exception when receiving create/update messages for rows on tables with ENUM fields.

      Table structure in question:

      CREATE TABLE `table_name` (
        `def` int(11) NOT NULL AUTO_INCREMENT,
        `ghi` int(11) NOT NULL DEFAULT '0',
        `jkl` varchar(80) NOT NULL DEFAULT '',
        `mno` varchar(255) NOT NULL DEFAULT '',
        `pqr` varchar(80) DEFAULT NULL,
        `column_name` enum('Foo','Bar','Baz') NOT NULL DEFAULT 'Foo',
        PRIMARY KEY (`def`),
        KEY `ghi` (`ghi`),
        KEY `mno` (`mno`),
        KEY `jkl` (`jkl`),
        KEY `pqr` (`pqr`)
      ) ENGINE=InnoDB AUTO_INCREMENT=459 DEFAULT CHARSET=utf8;
      

      Sample Row:

      2, 522, 'Something', 'Other', 'Anything', 'Foo'
      

      Exception encountered:

      2018-06-26 18:09:57,324 ERROR  MySQL|dev_db1|binlog  Failed to properly convert data value for 'db_name.table_name.column_name' of type ENUM for row [2, 522, [83, 111, 109, 101, 116, 104, 105, 110, 103], [79, 116, 104, 101, 114], [65, 110, 121, 116, 104, 105, 110, 103], 1]:   [io.debezium.relational.TableSchemaBuilder]
      org.apache.kafka.connect.errors.DataException: Invalid value: null used for required field: "column_name", schema type: STRING
          at org.apache.kafka.connect.data.ConnectSchema.validateValue(ConnectSchema.java:218)
          at org.apache.kafka.connect.data.Struct.put(Struct.java:216)
          at io.debezium.relational.TableSchemaBuilder.lambda$createValueGenerator$2(TableSchemaBuilder.java:193)
          at io.debezium.relational.TableSchema.valueFromColumnData(TableSchema.java:128)
          at io.debezium.connector.mysql.RecordMakers$1.insert(RecordMakers.java:211)
          at io.debezium.connector.mysql.RecordMakers$RecordsForTable.create(RecordMakers.java:418)
          at io.debezium.connector.mysql.BinlogReader.handleInsert(BinlogReader.java:763)
          at io.debezium.connector.mysql.BinlogReader.handleEvent(BinlogReader.java:436)
          at com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1055)
          at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:913)
          at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:559)
          at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:793)
          at java.lang.Thread.run(Thread.java:748)
      

      Attachments

        Activity

          People

            jpechane Jiri Pechanec
            tpbrowne Thomas Browne (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: