-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Can't restore from mysql 8.0 logical dump if charset is utf8 #31790
Comments
I don't think it is a bug since:
|
However, I think we need to support @morgo @djshow832 WDYT? |
My concerns are:
|
utf8mb3 is deprecated in MySQL, so it's a feature to change it. In the MySQL case they can't automatically change it because the collations would differ. In our case, our utf8mb4 collations are not strictly compatible anyway.
This is a minor issue. All the existing data (assuming it is importing a dump file) would still be 3 bytes. It would only be for 4 byte characters. The original motivation for MySQL using 3 bytes was that many in-memory internal buffers were fixed length, so utf8mb4 performed worse (and at the time utf8 was up to 6 bytes). This is no longer true, so there is not a use-case for 3-byte utf8. |
I thought this was because of MySQL considers the two create table statements identical: CREATE TABLE t1 (a int) DEFAULT CHARSET=utf8mb3;
CREATE TABLE t1 (a int) DEFAULT CHARSET=utf8; TiDB only permits the second statement. MySQL 8.0 changed the |
I'm afraid it cannot be applied. At the very early stages of TiDB, So finally TiDB decided to change |
I think #26226 is the same basic issue. |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
In MySQL 8.0, the charset utf8 is deprecated, to be replaced by utf8mb4. If a user previously created a table with 'utf8' it still points to the mb3 version for compatibility, but reading back the 'show create table' output it now also sets the value to utf8mb3.
In MySQL 8.0:
The output of SHOW CREATE TABLE t1 can not be restored on TiDB
if new collations are enabled(update: affects default config):2. What did you expect to see? (Required)
Success
3. What did you see instead (Required)
It would be nice if this instead internally remapped to utf8mb4 since that makes sense.
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: