Skip to content

TiCDC fill the default value without consider the real data type #10803

Closed
@3AceShowHand

Description

What did you do?

create table t (a int primary key, b varchar(100));

insert into t values (1, "nitto");
insert into t values (2, "hotd");

alter table t add column c int default 17;

update t set b = "earth" where a = 1;

delete from t where a = 4;

What did you expect to see?

The old value part for the column c, should have type int, instead of string

What did you see instead?

For both update and delete event, the old value is encoded as string, instead of real data type int. Since TiDB and TiCDC stores the default value as string, and TiCDC just use that value without considering the column data type.

Versions of the cluster

Upstream TiDB cluster version (execute SELECT tidb_version(); in a MySQL client):

(paste TiDB cluster version here)

Upstream TiKV version (execute tikv-server --version):

(paste TiKV version here)

TiCDC version (execute cdc version):

master

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

affects-6.5This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.affects-8.0area/ticdcIssues or PRs related to TiCDC.severity/moderatetype/bugThe issue is confirmed as a bug.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions