mysql2 icon indicating copy to clipboard operation
mysql2 copied to clipboard

WIP: Backport 0.4.x MySQL 8 Fixes to 0.3.x

Open felixbuenemann opened this issue 7 years ago • 12 comments

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_bool fix 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 avatar Jan 16 '18 23:01 felixbuenemann

@felixbuenemann are u still working on it. I will want to use MySQL 8.0 on an old ruby project.

imiskolee avatar Apr 22 '19 09:04 imiskolee

@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.

felixbuenemann avatar Apr 25 '19 14:04 felixbuenemann

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.

felixbuenemann avatar Apr 25 '19 17:04 felixbuenemann

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

felixbuenemann avatar Apr 25 '19 18:04 felixbuenemann

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.

felixbuenemann avatar Apr 26 '19 19:04 felixbuenemann

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.

felixbuenemann avatar Apr 26 '19 23:04 felixbuenemann

@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…

felixbuenemann avatar May 26 '19 08:05 felixbuenemann

beacuse the PXC 8.0 is coming, I am also blocking on this feature.

thanks @felixbuenemann. You're superman.

imiskolee avatar May 30 '19 16:05 imiskolee

@sodabrew Still waiting on some directions on how to proceed with this PR.

felixbuenemann avatar Jun 16 '19 08:06 felixbuenemann

@sodabrew Still waiting for feedback on this PR, see my comment from May 26th.

felixbuenemann avatar Sep 10 '19 14:09 felixbuenemann

+1

ermacaz avatar May 02 '23 15:05 ermacaz

+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.

waqarnazir340 avatar Feb 01 '24 08:02 waqarnazir340