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

After change column, null becomes ""

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • under-triaging
    • 1.9.5.Final
    • mysql-connector
    • None
    • False
    • None
    • False
    • Important

    Description

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

      Bug report

       

       

      CREATE TABLE sbtest003(
        id int,
        k INTEGER DEFAULT '0' NOT NULL,
        c CHAR(120) DEFAULT '' NOT NULL,
        d varchar(10) NOT NULL DEFAULT 'abc',
        pad varchar(60) DEFAULT NULL,
        cluster_id int default 100100 NOT NULL,
        primary key (id,cluster_id)
      );
      

       

       

      insert into sbtest003 values (1,1,'aa','AK47',null,1);

       

      After DDL like this :

       

      ALTER TABLE `dbname`.`sbtest003` CHANGE COLUMN d d varchar(9) ;

       

       

      insert into sbtest003 values (5,1,'aa',null,null,5);

       

       

      i  insert a null value into the column "d" ,but in kafka ,the data beacomes  "" . see:

       

      {
        "key": {
          "id": 5,
          "cluster_id": 5
        },
        "value": {
          "after": {
            "id": 5,
            "k": 1,
            "c": "aa",
            "d": "",
            "pad": null,
            "cluster_id": 5,
      

       

      if i do not  execute ddl ALTER TABLE `dbname`.`sbtest003` CHANGE COLUMN d d varchar(9) ;

      just insert a null value into the column "d" , in kafka ,it still is null.

       

       

       

      What Debezium connector do you use and what version?

      1.9.5Final

      What is the connector configuration?

      normal configuration

      What is the captured database version and mode of depoyment?

      (E.g. on-premises, with a specific cloud provider, etc.)

      Mysql 8.0+ Kafka 3.3.10

      What behaviour do you expect?

      Consistent data before and after

       

      What behaviour do you see?

      Consistent data before and after

       

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

      (Ideally, also verify with latest Alpha/Beta/CR version)

      NO

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

      (You might be asked later to provide DEBUG/TRACE level log)

      <Your answer>

      How to reproduce the issue using our tutorial deployment?

      <Your answer>

      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>

      Attachments

        Activity

          People

            Unassigned Unassigned
            henry19 Henry zhu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: