summaryrefslogtreecommitdiff
path: root/storage/federated
diff options
context:
space:
mode:
authorRamil Kalimullin <ramil@mysql.com>2011-12-23 17:22:48 +0400
committerRamil Kalimullin <ramil@mysql.com>2011-12-23 17:22:48 +0400
commit790a3a46f38ca1040f756fd64c0cca7b78b50f67 (patch)
tree73e4d1b4111765b4ed87e3be33f209d0f5e93438 /storage/federated
parent564d4a65bda21e36a408036723137d14a1aa1372 (diff)
downloadmariadb-git-790a3a46f38ca1040f756fd64c0cca7b78b50f67.tar.gz
Fix for bug#11758931 - 51196: SLAVE SQL: GOT AN ERROR WRITING
COMMUNICATION PACKETS, ERROR_CODE: 1160 If idle FEDERATED table is evicted from the table cache when a connection to remote server is lost, query that initiated eviction may fail. If this query is executed by slave SQL thread it may fail as well. An error of close was stored in diagnostics area, which was later attributed to the statement that caused eviction. With this patch FEDERATED clears an error of close.
Diffstat (limited to 'storage/federated')
-rw-r--r--storage/federated/ha_federated.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc
index 21c0b7b178d..64d5af446d8 100644
--- a/storage/federated/ha_federated.cc
+++ b/storage/federated/ha_federated.cc
@@ -1651,6 +1651,15 @@ int ha_federated::close(void)
mysql_close(mysql);
mysql= NULL;
+ /*
+ 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().
+ */
+ table->in_use->clear_error();
+
DBUG_RETURN(free_share(share));
}