summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql-common/client.c4
-rw-r--r--storage/federated/ha_federated.cc14
2 files changed, 13 insertions, 5 deletions
diff --git a/sql-common/client.c b/sql-common/client.c
index 850daa38750..c874086fc9c 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -3808,8 +3808,8 @@ void STDCALL mysql_close(MYSQL *mysql)
{
free_old_query(mysql);
mysql->status=MYSQL_STATUS_READY; /* Force command */
- mysql->reconnect=0;
simple_command(mysql,COM_QUIT,(uchar*) 0,0,1);
+ mysql->reconnect=0;
end_server(mysql); /* Sets mysql->net.vio= 0 */
}
mysql_close_free_options(mysql);
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc
index 409b4c40804..541b3327ad4 100644
--- a/storage/federated/ha_federated.cc
+++ b/storage/federated/ha_federated.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1678,9 +1678,17 @@ int ha_federated::close(void)
DBUG_ENTER("ha_federated::close");
free_result();
-
+
delete_dynamic(&results);
-
+
+ /*
+ Check to verify wheather the connection is still alive or not.
+ FLUSH TABLES will quit the connection and if connection is broken,
+ it will reconnect again and quit silently.
+ */
+ if (mysql && !vio_is_connected(mysql->net.vio))
+ mysql->net.error= 2;
+
/* Disconnect from mysql */
mysql_close(mysql);
mysql= NULL;