-
Notifications
You must be signed in to change notification settings - Fork 680
Default to standards-compliant utf8mb4 character set #935
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
Conversation
|
I think this default should depend on the server version: mysql < 5.5 cannot handle utf8mb4. |
|
@pasenor excellent point. |
|
Wait, how would that work? We set the charset before we make the connection. |
|
Oops, indeed, that's messy. But we should be able call set_charset() on the PyMySQL connection object inside our SQLExecute once know the version |
|
Note that
The |
|
@rolandwalker Is this PR still valid? Should this be merged? |
|
@amjith yes we should do something about it. Will review. |
02d03ef to
ecf6826
Compare
|
Reviving this old PR! The concern earlier was mostly that MySQL 5.5 didn't support the The PR has also been updated to add a |
ecf6826 to
592b84d
Compare
scottnemes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an old meme, but it checks out!
Verified client/connection charset is now utf8mb4 by default when connecting; looks good.
* default to standards-compliant utf8mn4 character set * create a default_character_set key in ~/.myclirc which overrides any setting in ~/.my.cnf (previously the only way to set a default) * document how to connect to ancient versions of MySQL which lack this character set
592b84d to
ffe9267
Compare
Description
xref #915
The
utf8character set in current MySQL versions is not actually standards-compliant. The standards-compliant UTF-8 character set is spelledutf8mb4, and that should be mycli's default.WIP because this should be researched/tested for MariaDB and Percona.Edit: tested on MariaDB. Researched for Percona: pages such as https://www.percona.com/blog/2018/04/10/migrating-database-charsets-to-utf8mb4/ have no suggestion of incompatibility.
Checklist
changelog.md.AUTHORSfile (or it's already there).