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

type enum default value is ignored when mount the event #9259

Closed
3AceShowHand opened this issue Jun 19, 2023 · 4 comments · Fixed by #9262
Closed

type enum default value is ignored when mount the event #9259

3AceShowHand opened this issue Jun 19, 2023 · 4 comments · Fixed by #9262
Labels
affects-5.2 affects-5.3 affects-5.4 affects-6.1 affects-6.5 affects-7.1 area/ticdc Issues or PRs related to TiCDC. component/mounter Mounter component needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.2 Should cherry pick this PR to release-7.2 branch. 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, state enum ("created", "working", "finished", "error") collate utf8mb4_general_ci not null default "created");
insert into t values (1, "working");

What did you expect to see?

No response

What did you see instead?

when drop the column state and insert new data at the delete-only phase, use old schema to parse the raw value, "created" should be used as the default value to fill the column.

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):

(paste TiCDC version here)
@3AceShowHand 3AceShowHand added type/bug The issue is confirmed as a bug. area/ticdc Issues or PRs related to TiCDC. labels Jun 19, 2023
@3AceShowHand
Copy link
Contributor Author

[2023/06/19 11:47:47.378 +08:00] [INFO] [mounter.go:365] ["datum2Column, inspect colult vmn info"] [colInfo="{\"id\":2,\"name\":{\"O\":\"state\",\"L\":\"state\"},\"offset\":1,\"origin_default\":null,\"origin_default_bit\":null,\"default\":\"created\",\"default_bit\":null,\"default_is_expr\":false,\"generated_expr_string\":\"\",\"generated_stored\":false,\"dependences\":null,\"type\":{\"Tp\":247,\"Flag\":1,\"Flen\":8,\"Decimal\":0,\"Charset\":\"utf8mb4\",\"Collate\":\"utf8mb4_general_ci\",\"Elems\":[\"created\",\"working\",\"finished\",\"error\"],\"ElemsIsBinaryLit\":null,\"Array\":false},\"state\":5,\"comment\":\"\",\"hidden\":false,\"change_state_info\":null,\"version\":2}"]

"created" is set as the default value field in the column info, but no used.

@3AceShowHand 3AceShowHand added the component/mounter Mounter component label Jun 19, 2023
@fubinzh
Copy link

fubinzh commented Jun 19, 2023

/severity moderate

@3AceShowHand 3AceShowHand added needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.2 Should cherry pick this PR to release-7.2 branch. labels Jun 19, 2023
ti-chi-bot bot pushed a commit that referenced this issue Jun 21, 2023
ti-chi-bot pushed a commit to ti-chi-bot/tiflow that referenced this issue Jun 21, 2023
@nongfushanquan
Copy link
Contributor

/label affects-6.1

@nongfushanquan
Copy link
Contributor

/label affects-6.5
/label affects-7.1

ti-chi-bot bot pushed a commit that referenced this issue Jun 30, 2023
ti-chi-bot bot pushed a commit that referenced this issue Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-5.2 affects-5.3 affects-5.4 affects-6.1 affects-6.5 affects-7.1 area/ticdc Issues or PRs related to TiCDC. component/mounter Mounter component needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.2 Should cherry pick this PR to release-7.2 branch. severity/moderate type/bug The issue is confirmed as a bug.
Projects
None yet
4 participants