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

Unsigned tinyint conversion fails for MySQL 8.x

XMLWordPrintable

    • False
    • None
    • False

      The TinyIntOneToBooleanConverter is applied based on the type name and length.
      For signed type this works as expected. The issue is on MySQL with unsigned type.
      The SHOW CREATE command drops the length for unsigned type like

      CREATE TABLE `DBZ5236` (
        `id` int NOT NULL AUTO_INCREMENT,
        `ti1` tinyint unsigned NOT NULL DEFAULT '0',
        `ti2` tinyint unsigned NOT NULL DEFAULT '0',
        `ti3` tinyint(1) NOT NULL DEFAULT '1',
        PRIMARY KEY (`id`)
      ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3
      

      But on the 5.7 the length is kept like

      CREATE TABLE `DBZ5236` (
        `id` int(11) NOT NULL AUTO_INCREMENT,
        `ti1` tinyint(3) unsigned NOT NULL DEFAULT '0',
        `ti2` tinyint(1) unsigned NOT NULL DEFAULT '0',
        `ti3` tinyint(1) NOT NULL DEFAULT '1',
        PRIMARY KEY (`id`)
      ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8
      

      See ti2 - this means that the converter is not applied at 8.0 server as the length is not defined.

            Unassigned Unassigned
            jpechane Jiri Pechanec
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: