Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
MXS-4508: Don't use MYSQL_OPT_RECONNECT in monitors
This causes problems with error reporting and might end up causing the
session variables to not be set correctly: the character set was set
with an explicit query which is lost if not set with MYSQL_INIT_COMMAND.

The automatic reconnection could also cause mariadbmon to lose the locks
without losing the connection. This would cause confusing errors as the
connection was indeed lost but wasn't reported back up to the monitor.
  • Loading branch information
markus456 committed Feb 14, 2023
1 parent 8478e72 commit d0cd7a7
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions server/core/mysql_utils.cc
Expand Up @@ -72,8 +72,6 @@ MYSQL* mxs_mysql_real_connect(MYSQL* con, SERVER* server, int port, const char*

bool server_is_db = server->info().is_database();

char yes = 1;
mysql_optionsv(con, MYSQL_OPT_RECONNECT, &yes);
if (server_is_db)
{
mysql_optionsv(con, MYSQL_INIT_COMMAND, "SET SQL_MODE=''");
Expand Down

0 comments on commit d0cd7a7

Please sign in to comment.