-
Notifications
You must be signed in to change notification settings - Fork 550
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
Set charset name utf8mb4 by default #1157
base: master
Are you sure you want to change the base?
Set charset name utf8mb4 by default #1157
Conversation
@kamipo Thanks for the PR! Though I am not a maintainer of this repository, let me share my opinion. I am seeing the mysql2 still supports Ruby 2.0.0 which are already EOL in Feb 2016 at this announcement from the Ruby project. So, I think By the way, I see a test failure for possibly every test cases.
Could you rebase this PR on the latest mater branch? We migrated main cases into GitHub Actions. I would like to see if the test failure still happens, and how affects to additional CI cases that we added to GitHub Actions. Thank you. |
For MariaDB, this repository's oldest MariaDB version is 10.0. And I was able to confirm the MariaDB 10.0 and latest MariaDB 10.5 supports utf8mb4. Here is the log on my environment using the MariaDB official container images.
For MairaDB 10.0 (port 13307)
For MairaDB 10.5 (port 13306)
|
mysql2 gem dropped testing for MySQL 5.1 which was released in Dec 2008 and already EOL in Dec 2013 at efa47a9. If we no longer support MySQL 5.1, utf8 (utf8mb3) is not appropriate default encoding for MySQL 5.5 or higher, utf8mb4 should be set for that. FYI, Rails 6.0 no longer support MySQL 5.1 and set utf8mb4 by default. rails/rails#33608 rails/rails#33853
44f4b51
to
52994c6
Compare
MySQL 8.0.29 reports warnings for
Here is an example. mysql> select @@version;
+-----------+
| @@version |
+-----------+
| 8.0.29 |
+-----------+
1 row in set (0.00 sec)
mysql> create table foo(id integer) character set utf8;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> show warnings;
+---------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Warning | 3719 | 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. |
+---------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> show create table foo\G
*************************** 1. row ***************************
Table: foo
Create Table: CREATE TABLE `foo` (
`id` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3
1 row in set (0.00 sec) |
mysql2 gem dropped testing for MySQL 5.1 which was released in Dec 2008
and already EOL in Dec 2013 at efa47a9.
If we no longer support MySQL 5.1, utf8 (utf8mb3) is not appropriate
default encoding for MySQL 5.5 or higher, utf8mb4 should be set for
that.
FYI, Rails 6.0 no longer support MySQL 5.1 and set utf8mb4 by default.
rails/rails#33608
rails/rails#33853