summaryrefslogtreecommitdiff
path: root/libmysql
diff options
context:
space:
mode:
authorunknown <msvensson@neptunus.(none)>2006-02-16 13:44:56 +0100
committerunknown <msvensson@neptunus.(none)>2006-02-16 13:44:56 +0100
commit7032a814f2884a3d56dedbcff9a08ba9157ced05 (patch)
treefb121a84d22f589c8e57b0110d9b698a3fcebd0f /libmysql
parentfb6928cb24db155027074e06f619736e50e86015 (diff)
downloadmariadb-git-7032a814f2884a3d56dedbcff9a08ba9157ced05.tar.gz
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
Diffstat (limited to 'libmysql')
-rw-r--r--libmysql/libmysql.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 11ee7284cbf..8e368090137 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);
}