Uploaded image for project: 'MariaDB MaxScale'
  1. MariaDB MaxScale
  2. MXS-2263

Maxscale CDC treats unsigned columns as signed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.17
    • Fix Version/s: 2.4.3
    • Component/s: avrorouter, cdc
    • Labels:
      None
    • Sprint:
      MXS-SPRINT-91

      Description

      Values in unsigned columns come across in JSON as signed.
      In this example, value 8888888 comes across as -7888328.

      To reproduce:

      CREATE TABLE `unsigned_test` (
      `unsigned_test_id` mediumint(8) unsigned DEFAULT NULL
      ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;

      INSERT INTO `unsigned_test` (`unsigned_test_id`)
      VALUES
      (3),
      (8000000),
      (8888888);

      JSON Output:

      {"namespace": "MaxScaleChangeDataSchema.avro", "type": "record", "name": "ChangeRecord", "fields": [

      {"name": "domain", "type": "int"}

      ,

      {"name": "server_id", "type": "int"}

      ,

      {"name": "sequence", "type": "int"}

      ,

      {"name": "event_number", "type": "int"}

      ,

      {"name": "timestamp", "type": "int"}

      , {"name": "event_type", "type": {"type": "enum", "name": "EVENT_TYPES", "symbols": ["insert", "update_before", "update_after", "delete"]}},

      {"name": "unsigned_test_id", "type": ["null", "int"], "real_type": "mediumint", "length": 8}

      ]}

      {"domain": 0, "server_id": 11009, "sequence": 9780915, "event_number": 1, "timestamp": 1547529921, "event_type": "insert", "unsigned_test_id": 3} {"domain": 0, "server_id": 11009, "sequence": 9781001, "event_number": 1, "timestamp": 1547529930, "event_type": "insert", "unsigned_test_id": 8000000} {"domain": 0, "server_id": 11009, "sequence": 9781377, "event_number": 1, "timestamp": 1547529978, "event_type": "insert", "unsigned_test_id": -7888328}

        Attachments

          Activity

            People

            Assignee:
            markus makela markus makela
            Reporter:
            sergiy.kyrychenko Sergiy Kyrychenko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: