From 725ce0fe84d4078895a5a31a2338f8d966c57710 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 8 May 2016 22:16:44 +0200 Subject: [PATCH] THD:: cleanup() must be where it used to between net_end() and ha_close_connection() this fixes lockups in main.locked_temporary-5955 and some other innodb tests. --- sql/sql_class.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/sql_class.cc b/sql/sql_class.cc index f460d318791..c08e5030061 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1650,6 +1650,8 @@ void THD::free_connection() net.vio= 0; net_end(&net); #endif + if (!cleanup_done) + cleanup(); ha_close_connection(this); plugin_thdvar_cleanup(this); mysql_audit_free_thd(this); @@ -1719,8 +1721,6 @@ THD::~THD() #endif if (!free_connection_done) free_connection(); - if (!cleanup_done) - cleanup(); mdl_context.destroy();