diff options
-rw-r--r-- | libmysql/libmysql.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 37566b2dfaa..3a532965551 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -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); } |