1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-07 02:42:49 +03:00

Fix for MDEV-10361: Don't try to reconnect twice: if mysql->options.reconnect is set,

ma_simple_command already tries to reconnect, so there is no need to reconnect in mysql_ping again
This commit is contained in:
Georg Richter
2018-01-16 15:24:54 +01:00
parent cfafbb6bab
commit adf7b569e3

View File

@@ -2539,13 +2539,7 @@ mysql_stat(MYSQL *mysql)
int STDCALL int STDCALL
mysql_ping(MYSQL *mysql) mysql_ping(MYSQL *mysql)
{ {
int rc; return ma_simple_command(mysql, COM_PING,0,0,0,0);
rc= ma_simple_command(mysql, COM_PING,0,0,0,0);
/* if connection was terminated and reconnect is true, try again */
if (rc!=0 && mysql->options.reconnect)
rc= ma_simple_command(mysql, COM_PING,0,0,0,0);
return rc;
} }
char * STDCALL char * STDCALL