1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-4066 semisync_master + temporary tables causes memory leaks

close (and auto-drop) temporary tables before
rolling back the last transaction in the connection.
This commit is contained in:
Sergei Golubchik
2013-03-05 17:49:37 +01:00
parent 7fb55ee807
commit 62b9be6542
3 changed files with 31 additions and 6 deletions

View File

@@ -0,0 +1,6 @@
include/master-slave.inc
[connection master]
INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master.so';
CREATE TEMPORARY TABLE tmp (i INT);
include/rpl_end.inc
uninstall plugin rpl_semi_sync_master;

View File

@@ -0,0 +1,19 @@
#
# MDEV-4066 semisync_master + temporary tables causes memory leaks
#
source include/have_semisync_plugin.inc;
source include/have_binlog_format_row.inc;
source include/master-slave.inc;
connection master;
--replace_result .dll .so
eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO';
--connect (con1,localhost,root,,)
CREATE TEMPORARY TABLE tmp (i INT);
--disconnect con1
source include/rpl_end.inc;
uninstall plugin rpl_semi_sync_master;

View File

@@ -1383,11 +1383,12 @@ void THD::cleanup(void)
#error xid_state in the cache should be replaced by the allocated value
}
#endif
{
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);