Commit 7032a814 authored by unknown's avatar unknown
Browse files

Bug#14057 mysql_ping() handles TCP and UNIX socket connections in different ways

 - Retry the ping if reconnect is turned on and the error was CR_SERVER_LOST


libmysql/libmysql.c:
  Send a new ping if first ping fails with CR_SERVER_LOST and reconnect is turned on
parent fb6928cb
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1370,8 +1370,12 @@ mysql_stat(MYSQL *mysql)
int STDCALL
mysql_ping(MYSQL *mysql)
{
  int res;
  DBUG_ENTER("mysql_ping");
  DBUG_RETURN(simple_command(mysql,COM_PING,0,0,0));
  res= simple_command(mysql,COM_PING,0,0,0);
  if (res == CR_SERVER_LOST && mysql->reconnect)
    res= simple_command(mysql,COM_PING,0,0,0);
  DBUG_RETURN(res);
}