-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Wrong value for replicating enum from mysql to Tidb #51908
Comments
This is related to #51097 |
This is the expected behaviour. DM uses the numeric index of ENUM when replicating. So after the column type changed to VARCHAR, it begins to insert numbers. You can enable TiDB's general log to see the SQL DM uses. And this is the repo for DM https://github.com/pingcap/tiflow/issues, you can open a feature request |
Sure, I have raised the feature request #10824 |
I think there are multiple ways of solving this:
(this is just some brainstorming about this, not guaranteed to be a solution)
|
Option - 4, 5 - Right now, upstream MySQL has lot of dependencies so it's not possible to change it to char or JSON Option - 3 - This is solving the enum issue but again virtual columns are not supported by TiFlash at the moment :(
Kind of blocked here, only one option is viable, convert these columns to char in TiDB, put a cron to update the actual value instead of index value and schedule this every minute. Do we have any timelines or future scope in Option- 1 or 2 ? |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
Step 1 : Created the table in MySQL
Step 2 : Inserted values into the same table
Step 3 : Migrated this table to TiDB using TiDB DM and checked it
Following is the output in TiDB
Step 4 : Then I changed the datatype from enum to varchar(2) in TiDB
Because the ENUM is a experimental feature for TiFLash
Step 5 : Again inserted data in MySQL
Step 6 : Again checked it in TiDB
This is what I get as the output
2. What did you expect to see? (Required)
I expect the same data as in the MySQL
3. What did you see instead (Required)
Instead I get the data i have changed to Varchar as 1 and 2.
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: