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

Cannot convert field type tinyint(1) unsigned to boolean

    XMLWordPrintable

Details

    • False
    • None
    • False

    Description

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

      Bug report

      For bug reports, provide this information, please:

      CREATE TABLE `retail_order_detail` (

        `id` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',

        `cdc_code` varchar(100) NOT NULL COMMENT 'code',

        `product` varchar(50) NOT NULL COMMENT '商品',

        `price` int NOT NULL COMMENT '价格',

        `city` varchar(50) NOT NULL COMMENT '城市',

        `user_deleted` tinyint unsigned NOT NULL DEFAULT '0' COMMENT 'user deleted journey,YES=1,NO=0',

        `is_completed` tinyint(1) NOT NULL DEFAULT '1',

        `b` boolean NOT NULL DEFAULT true,

        PRIMARY KEY (`id`)

      ) ENGINE=InnoDB AUTO_INCREMENT=58 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='零售表';

       

      field `is_completed` tinyint(1) can convert to boolean,

      but field `user_deleted` tinyint unsigned cannot convert to boolean

       

      insert into retail_order_detail(cdc_code,product,price,city,user_deleted,is_completed,b) values(400,"apple400",400,"合肥400",1,0,true)

       

      when insert data to table,convert result as follows:

      {'type': 'boolean', 'optional': False, 'default': True, 'field': 'is_completed'}

       
       

      {'type': 'int16', 'optional': False, 'default': 0, 'field': 'user_deleted'}

      What Debezium connector do you use and what version?

      debezium-connector-mysql-1.9.2.Final.jar

      What is the connector configuration?

       

      What is the captured database version and mode of depoyment?

      (E.g. on-premises, with a specific cloud provider, etc.)

      mysql 5.7

      What behaviour do you expect?

       field type tinyint unsigned can convert to boolean

      What behaviour do you see?

      insert into retail_order_detail(cdc_code,product,price,city,user_deleted,is_completed,b) values(400,"apple400",400,"合肥400",1,0,true)

       

      when insert data to table,convert result as follows:

      {'type': 'boolean', 'optional': False, 'default': True, 'field': 'is_completed'}

       
       

      {'type': 'int16', 'optional': False, 'default': 0, 'field': 'user_deleted'}

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              fy18759 fei yang
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: