Skip to content

Request to support MySQL 8.0 latest collations: utf8mb4_0900_ai_ic, etc.... #839

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

Closed
Delphier opened this issue Jul 19, 2018 · 10 comments · Fixed by #877
Closed

Request to support MySQL 8.0 latest collations: utf8mb4_0900_ai_ic, etc.... #839

Delphier opened this issue Jul 19, 2018 · 10 comments · Fixed by #877
Milestone

Comments

@Delphier
Copy link

MySQL 8.0 use utf8mb4_0900_ai_ci as default collation, but when set collation as this, an error occurs: unknown collation.

@methane
Copy link
Member

methane commented Jul 19, 2018

New collations which id<256 should be added to collations.go.

@Delphier
Copy link
Author

MySQL 8.0 has 270 collations, some collation id >255

@methane
Copy link
Member

methane commented Jul 19, 2018

MySQL's handshake reserves only one byte for collation id.
So we can use only collation which id >= 256 in handshake.

And collation for connection is not so important, while encoding for connection is important.
Each column should have own collation and it's used for normal cases.

@Delphier
Copy link
Author

OK, I get it now,that’s clear, thank you.

@julienschmidt
Copy link
Member

How does e.g. the official MySQL client transmit collations > 255 then?
If it is supported there, we can add support too.

@methane
Copy link
Member

methane commented Jul 19, 2018

Please don't close. collation id of utf8mb4_0900_ai_ic is 255. It should be supported.

@methane methane reopened this Jul 19, 2018
@methane
Copy link
Member

methane commented Jul 19, 2018

How does e.g. the official MySQL client transmit collations > 255 then?
If it is supported there, we can add support too.

MySQL client doesn't have API to specify collation. Only charset can be specified
and default collation for the charset is chosen.

When connection collation is really matters, client should:

  1. Connect with utf8mb4_unicode_520_ci
  2. SET NAMES utf8mb4 COLLATE <collation you really need>

Maybe, we can add collation support to charset option. For example, charset=utf8mb4: utf8mb4_ja_0900_as_cs.

@jason-gu
Copy link

Hi, I see a pull request ready for this issue, will it be merged anytime soon, so we can to use utf8mb4_0900_ai_ci (default for MySQL 8.x)?

@xtianus79
Copy link

I am receiving the same error.

ERROR 1273 (HY000) at line 1: Unknown collation: 'utf8mb4_0900_ai_ci'

@xtianus79
Copy link

sorry I mistakenly didn't update my server... I only updated workbench.

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

Successfully merging a pull request may close this issue.

5 participants