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:
6
mysql-test/suite/rpl/r/semisync_memleak_4066.result
Normal file
6
mysql-test/suite/rpl/r/semisync_memleak_4066.result
Normal 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;
|
19
mysql-test/suite/rpl/t/semisync_memleak_4066.test
Normal file
19
mysql-test/suite/rpl/t/semisync_memleak_4066.test
Normal 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;
|
||||
|
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user