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

MySQL TINYINT and SMALLINT columns should be mapped as INT16 rather than INT32

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 0.2.3, 0.3
    • 0.2.2
    • mysql-connector
    • None

    Description

      The MySQL connector currently maps TINYINT and SMALLINT columns to INT32, but they should instead map to INT16 since the range of TINYINT values is either -128 to 127 for signed or 0 to 255 for unsigned. Since INT8 can only handle values in the range 0 to 255, and therefore INT8 is not a good choice for a value. And the JDBC Specification also suggest the proper Java type for SQL-99's TINYINT is short, which maps to Kafka Connect's INT16.

      This change will be backward compatible, although the generated Kafka Connect schema will be different than in previous versions. This shouldn't cause a problem, since clients should expect to handle schema changes, and this schema change does comply with Avro schema evolution rules.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: