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

If COM_PING failed, check if reconnect option was set before calling

mysql_ping again.
This commit is contained in:
Georg Richter
2018-02-17 12:22:18 +01:00
parent 83eef02ec8
commit 80b2ae25bd

View File

@@ -2539,7 +2539,7 @@ mysql_ping(MYSQL *mysql)
{ {
int rc; int rc;
rc= ma_simple_command(mysql, COM_PING, 0, 0, 0, 0); rc= ma_simple_command(mysql, COM_PING, 0, 0, 0, 0);
if (rc && mysql_errno(mysql) == CR_SERVER_LOST) if (rc && mysql->options.reconnect)
rc= ma_simple_command(mysql, COM_PING, 0, 0, 0, 0); rc= ma_simple_command(mysql, COM_PING, 0, 0, 0, 0);
return rc; return rc;
} }