summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-03-05 17:49:37 +0100
committerSergei Golubchik <sergii@pisem.net>2013-03-05 17:49:37 +0100
commit62b9be65422fc498356e122a7b9ca08f2ada9d0b (patch)
treeaebaa39788f9e46fc83db005f1e4aab4a097eb5a /sql/sql_class.cc
parent7fb55ee807937ab78c95cf247747c5711449fc20 (diff)
downloadmariadb-git-62b9be65422fc498356e122a7b9ca08f2ada9d0b.tar.gz
MDEV-4066 semisync_master + temporary tables causes memory leaks
close (and auto-drop) temporary tables before rolling back the last transaction in the connection.
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 18b59a8c2fc..33dc4218e95 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -1383,11 +1383,12 @@ void THD::cleanup(void)
#error xid_state in the cache should be replaced by the allocated value
}
#endif
- {
- transaction.xid_state.xa_state= XA_NOTR;
- trans_rollback(this);
- xid_cache_delete(&transaction.xid_state);
- }
+
+ close_temporary_tables(this);
+
+ transaction.xid_state.xa_state= XA_NOTR;
+ trans_rollback(this);
+ xid_cache_delete(&transaction.xid_state);
locked_tables_list.unlock_locked_tables(this);
mysql_ha_cleanup(this);
@@ -1421,7 +1422,6 @@ void THD::cleanup(void)
delete_dynamic(&user_var_events);
my_hash_free(&user_vars);
- close_temporary_tables(this);
sp_cache_clear(&sp_proc_cache);
sp_cache_clear(&sp_func_cache);