mysql2
mysql2 copied to clipboard
WIP: Backport 0.4.x MySQL 8 Fixes to 0.3.x
This backports the MySQL 8.0 fixes from the 0.4.x series to 0.3.x.
- The 8.0.3 fixes are exactly the same as #892.
- For the 8.0.1
my_boolfix I ported the solution from #919 instead of #840, because I think it has a lower chance of causing issues for existing users with old MySQL versions or compilers.
@felixbuenemann are u still working on it. I will want to use MySQL 8.0 on an old ruby project.
@imiskolee Have you tried bundling from the feature branch in my fork to see if it works?
The Travis CI logs are gone, so I don't know why they failed back then.
I have no recollection on which project I used it, but I'm pretty sure it worked fine.
Looks like the Travis CI setup needs some love, I'll look into it.
Aside from that I fixed a missing return value for set_secure_auth on MySQL 8 due to an error in the original backport.
OK, tracked down the specs errors in docker. The reason was a bad setting of :sslcapath => '/etc/mysql/' in client_spec.rb that caused the /etc/mysql directory to be treated as a CA directory.
This caused problems, since the specs are running asn unpriviledged user and the directory contains some files that are only accessible by root, like debian.cnf.
Since the :sslcapath setting didn't make any sense when also setting :sslca, I simply dropped the setting.
The problem can also be reproduced with the mysql cli:
su nobody -c "mysql --ssl-capath=/etc/mysql/ --ssl-mode=REQUIRED --ssl=1 --ssl-cert=/etc/mysql/client-cert.pem --ssl-key=/etc/mysql/client-key.pem --ssl-ca=/etc/mysql/ca-cert.pem --ssl-cipher=DHE-RSA-AES256-SHA"
ERROR 2026 (HY000): SSL connection error: SSL_CTX_set_default_verify_paths failed
su nobody -c "mysql --ssl-mode=REQUIRED --ssl=1 --ssl-cert=/etc/mysql/client-cert.pem --ssl-key=/etc/mysql/client-key.pem --ssl-ca=/etc/mysql/ca-cert.pem --ssl-cipher=DHE-RSA-AES256-SHA"
ERROR 1045 (28000): Access denied for user 'nobody'@'localhost' (using password: NO)
# or connects fine with --user=root
Still working out some problems with MySQL 5.7 release versions and charset list, so added WIP marker.
I also have another branch were I updated CI to Trusty, since Precise is very deprecated and being phased out on Travis CI.
To reduce noise on this PR I'm doping that work on seperate branches with my own travis account.
OK, CI is looking good now and was upgrade to Trusty / MySQL 5.6 as default, but MySQL 8.0 uses Xenial, due to lack of packages. An additional matrix entry downgrades to MySQL 5.5 on Trusty.
I've also found a bug with the encoding list, that I'll port over to master (see 091e1d5, 246013e) and added support for MariaDB 10.2 / 10.3.
@sodabrew I think from the changes this PR is done.
Please let me know, if you'd like me to split it up into multiple PRs, since it now contains fixes for CI, MariaDB 10.2/10.3 and MySQL 8.0.
The CI changes also contain some fixes that are done in a similar fashion but slightly different on master…
beacuse the PXC 8.0 is coming, I am also blocking on this feature.
thanks @felixbuenemann. You're superman.
@sodabrew Still waiting on some directions on how to proceed with this PR.
@sodabrew Still waiting for feedback on this PR, see my comment from May 26th.
+1
+1 Amazon RDS will be ending EOS support for MYSQL 5.7 on February 29, 2024, Some legacy Rails projects (version 3.x) do exist that are only compatible with mysql2 0.3.x version. This MYSQL 8 support in mysql2 0.3.x will be really helpful in cutting some project costs avoiding RDS MYSQL 5.7 EOL support. @sodabrew your response on it will really be appreciated.