Skip to content

Commit b0f72a4

Browse files
author
Arun Kuruvila
committed
Merging from mysql-5.5 to mysql-5.6
2 parents 3f8b4ad + a9b61b0 commit b0f72a4

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

sql-common/client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4065,8 +4065,8 @@ void STDCALL mysql_close(MYSQL *mysql)
40654065
{
40664066
free_old_query(mysql);
40674067
mysql->status=MYSQL_STATUS_READY; /* Force command */
4068-
mysql->reconnect=0;
40694068
simple_command(mysql,COM_QUIT,(uchar*) 0,0,1);
4069+
mysql->reconnect=0;
40704070
end_server(mysql); /* Sets mysql->net.vio= 0 */
40714071
}
40724072
mysql_close_free_options(mysql);

storage/federated/ha_federated.cc

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -1675,9 +1675,17 @@ int ha_federated::close(void)
16751675
DBUG_ENTER("ha_federated::close");
16761676

16771677
free_result();
1678-
1678+
16791679
delete_dynamic(&results);
1680-
1680+
1681+
/*
1682+
Check to verify wheather the connection is still alive or not.
1683+
FLUSH TABLES will quit the connection and if connection is broken,
1684+
it will reconnect again and quit silently.
1685+
*/
1686+
if (mysql && !vio_is_connected(mysql->net.vio))
1687+
mysql->net.error= 2;
1688+
16811689
/* Disconnect from mysql */
16821690
mysql_close(mysql);
16831691
mysql= NULL;

0 commit comments

Comments
 (0)