perl5-dbi / DBD-MariaDB

Perl MariaDB driver

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

As of MySQL 8.0.34 and 8.1.0 's libmysqlclients deprecates MYSQL_OPT_RECONNECT

mroemer opened this issue · comments

Since Ubuntu rolled out libmysqlclient21 8.0.34-0ubuntu0.22.04.1, a warning is thown everytime DBD::MariaDB connects: WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.

This is due to the deprecation of MYSQL_OPT_RECONNECT, which is only used at:

DBD-MariaDB/dbdimp.c

Lines 2364 to 2371 in e81937d

#if MYSQL_VERSION_ID >= 50013
{
my_bool reconnect = FALSE;
mysql_options(sock, MYSQL_OPT_RECONNECT, &reconnect);
}
#else
sock->reconnect = FALSE;
#endif

See perl5-dbi/DBD-mysql#354

Copied from there:

The MySQL client library currently supports performing an automatic reconnection to the server if it finds that the connection is down and an application attempts to send a statement to the server to be executed. Now, this feature is deprecated and subject to removal in a future release of MySQL.

The related MYSQL_OPT_RECONNECT option is still available but it is also deprecated. C API functions mysql_get_option() and mysql_options() now write a deprecation warning to the standard error output when an application specifies MYSQL_OPT_RECONNECT. (WL #15766)

https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-34.html#mysqld-8-0-34-deprecation-removal
https://dev.mysql.com/doc/relnotes/mysql/8.1/en/news-8-1-0.html#mysqld-8-1-0-deprecation-removal

commented

I'm already watching the linked DBD-mysql issue. I'm planning to prepare DBD-MariaDB patches for fixing MySQL 8.x compatibility. This one is issue to fix/workaround. But the issue #160 is harder and I do not know what to do with it...

commented

Fix for this issue is ready in pull request: #192