diff options
author | Sergei Golubchik <serg@mariadb.org> | 2015-12-21 21:24:22 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-12-21 21:24:22 +0100 |
commit | a2bcee626d4ef2836e38e4932305871390164644 (patch) | |
tree | b41e357427318bad8985078b91bbd2b0360defc8 /storage/federated | |
parent | 1788bfe93a745582d938a608d5959b7d2e6b2f23 (diff) | |
parent | 4fdf25afa8188905653a83e08fc387243e584600 (diff) | |
download | mariadb-git-a2bcee626d4ef2836e38e4932305871390164644.tar.gz |
Merge branch '10.0' into 10.1
Diffstat (limited to 'storage/federated')
-rw-r--r-- | storage/federated/ha_federated.cc | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc index e75c3ca4121..0bf4d766d64 100644 --- a/storage/federated/ha_federated.cc +++ b/storage/federated/ha_federated.cc @@ -1648,6 +1648,20 @@ int ha_federated::open(const char *name, int mode, uint test_if_locked) DBUG_RETURN(0); } +class Net_error_handler : public Internal_error_handler +{ +public: + Net_error_handler() {} + +public: + bool handle_condition(THD *thd, uint sql_errno, const char* sqlstate, + Sql_condition::enum_warning_level level, + const char* msg, Sql_condition ** cond_hdl) + { + return sql_errno >= ER_ABORTING_CONNECTION && + sql_errno <= ER_NET_WRITE_INTERRUPTED; + } +}; /* Closes a table. We call the free_share() function to free any resources @@ -1669,18 +1683,15 @@ int ha_federated::close(void) delete_dynamic(&results); /* Disconnect from mysql */ + THD *thd= ha_thd(); + Net_error_handler err_handler; + if (thd) + thd->push_internal_handler(&err_handler); mysql_close(mysql); - mysql= NULL; + if (thd) + thd->pop_internal_handler(); - /* - mysql_close() might return an error if a remote server's gone - for some reason. If that happens while removing a table from - the table cache, the error will be propagated to a client even - if the original query was not issued against the FEDERATED table. - So, don't propagate errors from mysql_close(). - */ - if (table->in_use) - table->in_use->clear_error(); + mysql= NULL; DBUG_RETURN(free_share(share)); } |