diff options
author | Arun Kuruvila <arun.kuruvila@oracle.com> | 2016-02-23 12:10:41 +0530 |
---|---|---|
committer | Arun Kuruvila <arun.kuruvila@oracle.com> | 2016-02-23 12:10:41 +0530 |
commit | 4ed09d54f53771383b943ee6610dae5faa068cff (patch) | |
tree | 6b6a8c21df558c76de9b925e9d6493710ab48bd9 /storage | |
parent | 447eaa5bc04761555f066d911397e41187d43af5 (diff) | |
download | mariadb-git-4ed09d54f53771383b943ee6610dae5faa068cff.tar.gz |
Diffstat (limited to 'storage')
-rw-r--r-- | storage/federated/ha_federated.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc index 8209b5a2fcf..b47c4565743 100644 --- a/storage/federated/ha_federated.cc +++ b/storage/federated/ha_federated.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2004, 2016, 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 @@ -1675,6 +1675,7 @@ int ha_federated::open(const char *name, int mode, uint test_if_locked) int ha_federated::close(void) { + THD *thd= current_thd; DBUG_ENTER("ha_federated::close"); free_result(); @@ -1686,7 +1687,7 @@ int ha_federated::close(void) 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)) + if (mysql && (!mysql->net.vio || !vio_is_connected(mysql->net.vio))) mysql->net.error= 2; /* Disconnect from mysql */ @@ -1700,9 +1701,16 @@ int ha_federated::close(void) if the original query was not issued against the FEDERATED table. So, don't propagate errors from mysql_close(). */ - if (table->in_use) + if (table->in_use && thd != table->in_use) table->in_use->clear_error(); + /* + Errors from mysql_close() are silently ignored for flush tables. + Close the connection silently. + */ + if (thd && thd->lex->sql_command == SQLCOM_FLUSH) + thd->clear_error(); + DBUG_RETURN(free_share(share)); } |