summaryrefslogtreecommitdiff
path: root/storage/federatedx
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-12-06 01:48:07 +0100
committerSergei Golubchik <serg@mariadb.org>2015-12-07 15:20:23 +0100
commit18954ff25d27252f3ce9865e636c91e0783572af (patch)
treef69ab1089475cbcb6fd74938f077cf4e2b42ef09 /storage/federatedx
parent354e567c2384f95126ffa1e36382c4e0c206521c (diff)
downloadmariadb-git-18954ff25d27252f3ce9865e636c91e0783572af.tar.gz
MDEV-8313 Got an error writing communication packets
Don't let network errors from mysql_close() leak into THD. * remove incorrect upstream fix ** table->in_use can be NULL, must use ha_thd() ** clear_error() may remove earlier errors, don't use it * fix the bug properly in federated and federatedx
Diffstat (limited to 'storage/federatedx')
-rw-r--r--storage/federatedx/ha_federatedx.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc
index 05a11fe31a7..c9b07a8f3c3 100644
--- a/storage/federatedx/ha_federatedx.cc
+++ b/storage/federatedx/ha_federatedx.cc
@@ -1795,6 +1795,20 @@ int ha_federatedx::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,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* msg, MYSQL_ERROR ** 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
@@ -1825,7 +1839,12 @@ int ha_federatedx::close(void)
txn->release(&io);
DBUG_ASSERT(io == NULL);
+ Net_error_handler err_handler;
+ if (thd)
+ thd->push_internal_handler(&err_handler);
free_share(txn, share);
+ if (thd)
+ thd->pop_internal_handler();
DBUG_RETURN(retval);
}