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

MySQL Connector doesn't handle any value above '2147483647' for 'INT UNSIGNED' types

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 0.5.1
    • 0.5
    • mysql-connector
    • None

    Description

      Background:
      If we have a table with a column of type `INT UNSIGNED`, MySQL Converter will attempt to convert any value above the maximum of `INT SIGNED` type (2147483647) into the difference of:
      Any value above the maximum for `INT SIGNED` (2147483647) - maximum value for `INT UNSIGNED` (4294967295) - 1

      Steps to produce:
      Let's assume we have this table definition:

      CREATE TABLE `unsigned_test` (
        `id` int(10) NOT NULL,
        `value` int(11) unsigned,
        PRIMARY KEY (`id`)
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
      
      • If we run this query:
        INSERT INTO `unsigned_test` (`id`, `value`) VALUES ('1', '2147483647');
        

        The Kafka Struct will look like this:

        Struct{id=1,value=2147483647}
        
      • If we run this query:
        INSERT INTO `unsigned_test` (`id`, `value`) VALUES ('2', '2147483648');
        

        The Kafka Struct will look like this:

        Struct{id=2,value=-2147483648}
        
      • If we run this query:
        INSERT INTO `unsigned_test` (`id`, `value`) VALUES ('2', '4294967295');
        

        The Kafka Struct will look like this:

        Struct{id=2,value=-1}
        

      Expected behavior:
      MySQL Converter shall treat normally any value within the boundary of `0` to `4294967295` for any column type of `INT UNSIGNED`.

      Note:
      The same behavior is reproducible on 'TINYINT', 'SMALLINT', 'MEDIUMINT' and 'BIGINT'.

      Attachments

        Activity

          People

            omarsmak@gmail.com Omar Al-Safi (Inactive)
            omarsmak@gmail.com Omar Al-Safi (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: