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

binary field not correctly parsed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • 0.2
    • 0.1
    • mysql-connector
    • None

      When the database contains the following table:

      CREATE TABLE t1464075356413_testtable6 (
        pk_column int auto_increment NOT NULL,
        varbinary_col varbinary(20) NOT NULL,
        PRIMARY KEY(pk_column)
      );
      

      and the MySQL connector is monitoring it, when a row is inserted with a blob field as a hex string as follows:

      INSERT INTO t1464075356413_testtable6 (pk_column, varbinary_col)
      VALUES(default, 0x4D7953514C)
      

      the connector will produce an error:

      connect_1                 | 2016-05-24 07:36:18,731 - ERROR [WorkerSourceTask-inventory-connector-0:WorkerSourceTask$WorkerSourceTaskThread@362] - Task inventory-connector-0 threw an uncaught and unrecoverable exception
      connect_1                 | 2016-05-24 07:36:18,734 - ERROR [WorkerSourceTask-inventory-connector-0:WorkerSourceTask$WorkerSourceTaskThread@363] - Task is being killed and will not recover until manually restarted:
      connect_1                 | java.lang.ClassCastException: java.lang.String cannot be cast to [B
      connect_1                 | 	at io.debezium.relational.TableSchemaBuilder.lambda$createValueConverterFor$9(TableSchemaBuilder.java:446)
      connect_1                 | 	at io.debezium.relational.TableSchemaBuilder.lambda$createValueGenerator$3(TableSchemaBuilder.java:186)
      connect_1                 | 	at io.debezium.relational.TableSchema.valueFromColumnData(TableSchema.java:109)
      connect_1                 | 	at io.debezium.connector.mysql.TableConverters$1.inserted(TableConverters.java:213)
      connect_1                 | 	at io.debezium.connector.mysql.TableConverters.handleInsert(TableConverters.java:256)
      connect_1                 | 	at io.debezium.connector.mysql.MySqlConnectorTask.poll(MySqlConnectorTask.java:281)
      connect_1                 | 	at org.apache.kafka.connect.runtime.WorkerSourceTask$WorkerSourceTaskThread.execute(WorkerSourceTask.java:353)
      connect_1                 | 	at org.apache.kafka.connect.util.ShutdownableThread.run(ShutdownableThread.java:82)
      

              rhauch Randall Hauch (Inactive)
              wangshao_jira barten barten (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: