Skip to content
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

Fix support for MySQL 8.0 #192

Merged
merged 7 commits into from
Sep 6, 2023
Merged

Fix support for MySQL 8.0 #192

merged 7 commits into from
Sep 6, 2023

Conversation

pali
Copy link
Member

@pali pali commented Aug 21, 2023

  • Add new versions for testing on Github Actions CI
  • Do not use MYSQL_OPT_RECONNECT for MySQL 8.0.34+ clients
  • MySQL 8.0.20 client library has fixed reinitialization bug
  • Fix MariaDB server version check in t/40server_prepare.t test
  • Skip t/rt122541-decimals.t test for MySQL 8.0.22+ server versions
  • Add new DECIMAL testcase into t/rt122541-decimals.t
  • accept 4031 as a valid return code when connection closed

pali and others added 7 commits August 13, 2023 11:58
Beginning with MySQL 8.0.34, the automatic reconnection feature is
deprecated and disabled by default.

When MYSQL_OPT_RECONNECT is used then client prints to stderr message:

  WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.

Fixes: perl5-dbi#191
Adjust workaround for affected MySQL client versions which prevents
cleaning up of MySQL client resources.

See: https://bugs.mysql.com/bug.php?id=93276
Distinguish between MariaDB and MySQL servers by DBI's get_info(SQL_DBMS_NAME) call.
Unfortunately it looks like that MySQL 8.0.22+ server versions have broken
SQL ROUND() function, it returns incorrect number of rounded decimals in
column metadata information, which DBD::MariaDB uses internally for
converting returned value via MySQL network protocol to Perl scalar.

Skip this tests for affected MySQL server versions until we figure out what
to do with this test case. This at least allows to install DBD::MariaDB
with enabled tests during install phase.

See: perl5-dbi#160
Add a new test case with CAST AS DECIMAL which verifies that support for
trailing zeros in decimal numbers is working in Perl. This test case works
also with new MySQL server versions 8.0.22+ but on the other hand it does
not work with older MySQL client or server versions.
As of 8.0.24 MySQL writes the reason the connection was closed before
closing it, so 4031 (ER_CLIENT_INTERACTION_TIMEOUT) is now an valid
return code. See

https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-24.html#mysqld-8-0-24-connection-management

for more information.

This addresses the issue reported in perl5-dbi/DBD-mysql#329
@pali
Copy link
Member Author

pali commented Aug 26, 2023

@choroba could you look at this PR?

@pali pali merged commit 0534b71 into perl5-dbi:master Sep 6, 2023
206 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants