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

sqlserver cdc default value error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • None
    • None
    • None
    • False
    • None
    • False

      The value in the table is null, but the cdc results is 0

      demo:

      CREATE TABLE [dbo].[AA_test] (
        [id] int  NOT NULL,
        [name] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
        [age] int  NULL,
        [phone] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
        [number_0] bigint DEFAULT ((0)) NULL,
        [datetime_0] datetime  NULL,
        CONSTRAINT [PK__AA_test_ID] PRIMARY KEY CLUSTERED ([id])
      WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
      ON [PRIMARY]
      )  
      ON [PRIMARY]
      GO

      ALTER TABLE [dbo].[AA_test] SET (LOCK_ESCALATION = TABLE)

      -------------------------------------------------------------------------

      INSERT INTO [dbo].[AA_test]([id], [name], [age], [phone], [number_0], [datetime_0]) VALUES (7, 'tester', 1, '911', NULL, NULL);

      -------------------------------------------------------------------------

      In the table number_0 = null, but in the collected data, number_0 = 0

      I know number_0 default 0 in ddl, but l hope cdc results are consistent with the actual values

      Is there any way to adjust it?

              Unassigned Unassigned
              rking123 rui jin (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: