Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
3AceShowHand opened this issue Mar 18, 2024 · 0 comments · Fixed by #10804
Closed

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

3AceShowHand opened this issue Mar 18, 2024 · 0 comments · Fixed by #10804
Assignees
Labels
affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.0 area/ticdc Issues or PRs related to TiCDC. severity/moderate type/bug The issue is confirmed as a bug.

Comments

@3AceShowHand
Copy link
Contributor

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
@3AceShowHand 3AceShowHand added type/bug The issue is confirmed as a bug. area/ticdc Issues or PRs related to TiCDC. labels Mar 18, 2024
@3AceShowHand 3AceShowHand self-assigned this Mar 18, 2024
@3AceShowHand 3AceShowHand added type/enhancement The issue or PR belongs to an enhancement. type/bug The issue is confirmed as a bug. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.0 severity/moderate and removed type/bug The issue is confirmed as a bug. severity/minor type/enhancement The issue or PR belongs to an enhancement. labels Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.0 area/ticdc Issues or PRs related to TiCDC. severity/moderate type/bug The issue is confirmed as a bug.
Projects
Development

Successfully merging a pull request may close this issue.

1 participant