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

Error when alter Enum column with CHARACTER SET

    XMLWordPrintable

    Details

    • Steps to Reproduce:
      Hide

      1. Create table
      CREATE TABLE `test_stations_10` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `name` varchar(500) COLLATE utf8_unicode_ci NOT NULL,
      `type` enum('station','post_office') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'station',
      `created` datetime DEFAULT CURRENT_TIMESTAMP,
      `modified` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
      PRIMARY KEY (`id`)
      );

      2. insert into test_stations_10( `name`, `type`) values ('Ha Tinh 7', 'station');
      3. ALTER TABLE `test_stations_10` MODIFY COLUMN `type` ENUM('station', 'post_office', 'plane', 'ahihi_dongok', 'now') CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' NOT NULL DEFAULT 'station';
      4. insert into test_stations_10( `name`, `type`) values ('Ha Tinh 1', 'now');

      Show
      1. Create table CREATE TABLE `test_stations_10` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(500) COLLATE utf8_unicode_ci NOT NULL, `type` enum('station','post_office') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'station', `created` datetime DEFAULT CURRENT_TIMESTAMP, `modified` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ); 2. insert into test_stations_10( `name`, `type`) values ('Ha Tinh 7', 'station'); 3. ALTER TABLE `test_stations_10` MODIFY COLUMN `type` ENUM('station', 'post_office', 'plane', 'ahihi_dongok', 'now') CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' NOT NULL DEFAULT 'station'; 4. insert into test_stations_10( `name`, `type`) values ('Ha Tinh 1', 'now');

      Description

      When create table with Enum colum, after alter table with CHARACTER SET then DBZ parse failed and so schema is not good
      And then cannot get correct data from kafka

      This is schema field `type`
      {
      "name": "type",
      "type": [
      "null",
      {
      "type": "string",
      "connect.version": 1,
      "connect.parameters":

      { "allowed": "station,post_office,plane,ahihi_dongok,now') CHARACTER SET 'utf8" }

      ,
      "connect.name": "io.debezium.data.Enum"
      }
      ],
      "default": null
      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ccranfor Chris Cranford
              Reporter:
              kiakaku Dinh Man Nguyen
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: