Skip to content

Commit

Permalink
Do not use MYSQL_OPT_RECONNECT for MySQL 8.0.34+ clients
Browse files Browse the repository at this point in the history
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: #191
  • Loading branch information
pali committed Aug 13, 2023
1 parent f375f85 commit c3da544
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dbdimp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2362,10 +2362,13 @@ static bool mariadb_dr_connect(
so that we can keep track of when this happens.
*/
#if MYSQL_VERSION_ID >= 50013
/* Beginning with MySQL 8.0.34, the automatic reconnection feature is deprecated and disabled by default. */
#if defined(MARIADB_BASE_VERSION) || MYSQL_VERSION_ID < 80034
{
my_bool reconnect = FALSE;
mysql_options(sock, MYSQL_OPT_RECONNECT, &reconnect);
}
#endif
#else
sock->reconnect = FALSE;
#endif
Expand Down

0 comments on commit c3da544

Please sign in to comment.