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

Nullable columns marked with "optional: false" in DDL events

XMLWordPrintable

    • False
    • None
    • False
    • Important

      In order to make your issue reports as actionable as possible, please provide the following information, depending on the issue type.

      Bug report

      Execute the ddl in the source DB:

       

      CREATE TABLE `dd2` (
      	`id` INT ( 11 ) NOT NULL,
      	`name` VARCHAR ( 255 ),
      	UNIQUE KEY `test` ( `name` ) ,
      	PRIMARY KEY ( `id` )
      ) ENGINE = INNODB; 

      In the event captured by debezium, the column `name` is marked as not null (optional = false), which is opposite to the original ddl:

      "ddl": "CREATE TABLE `dd2` (\r\n\t`id` INT ( 11 ) NOT NULL,\r\n\t`name` VARCHAR ( 255 ),\r\n\tUNIQUE KEY `test` ( `name` ) ,\r\n\tPRIMARY KEY ( `id` )\r\n) ENGINE = INNODB",
      "tableChanges": [
        {
          "type": "CREATE",
          "id": "\"mdm_source\".\"dd2\"",
          "table": {
            "defaultCharsetName": null,
            "primaryKeyColumnNames": [
              "id"
            ],
            "columns": [
             

      {           "name": "id",           "jdbcType": 4,           "typeName": "INT",           "typeExpression": "INT",           "charsetName": null,           "length": 11,           "position": 1,           "optional": false,           "autoIncremented": false,           "generated": false         }

      ,
             

      {           "name": "name",           "jdbcType": 12,           "typeName": "VARCHAR",           "typeExpression": "VARCHAR",           "charsetName": null,           "length": 255,           "position": 2,           "optional": false,           "autoIncremented": false,           "generated": false         }

            ]
          }
        }
      ]

      What Debezium connector do you use and what version?

      mysql connector, 1.5.4

      What is the connector configuration?

      "key.converter.schemas.enable": "true"
      "value.converter.schemas.enable": "true"
      "include.schema.changes": "true"

      What is the captured database version and mode of depoyment?

      mysql 8.0.17

      What behaviour do you expect?

      column marked as nullable

      What behaviour do you see?

      column marked as not null

            Unassigned Unassigned
            ldwntjs David L (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: