Commit e26b2071 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-7938 MariaDB Crashes Suddenly while writing binlogs

on disconnect THD must clean user_var_events array before
dropping temporary tables. Otherwise when binlogging a DROP,
it'll access user_var_events, but they were allocated
in the already freed memroot.
parent 053143ef
create table t1 (i int);
create trigger tr after insert on t1 for each row set @b=@a;
create temporary table tmp like t1;
insert into t1 values (1);
select * from t1;
i
1
drop table t1;
#
# MDEV-7938 MariaDB Crashes Suddenly while writing binlogs
#
--source include/have_log_bin.inc
--source include/have_binlog_format_mixed.inc
--connect(con1,localhost,root,,)
create table t1 (i int);
create trigger tr after insert on t1 for each row set @b=@a;
create temporary table tmp like t1;
insert into t1 values (1);
--disconnect con1
--connection default
select * from t1;
drop table t1;
......@@ -1394,6 +1394,7 @@ void THD::cleanup(void)
mysql_ha_cleanup(this);
locked_tables_list.unlock_locked_tables(this);
delete_dynamic(&user_var_events);
close_temporary_tables(this);
transaction.xid_state.xa_state= XA_NOTR;
......@@ -1427,7 +1428,6 @@ void THD::cleanup(void)
debug_sync_end_thread(this);
#endif /* defined(ENABLED_DEBUG_SYNC) */
delete_dynamic(&user_var_events);
my_hash_free(&user_vars);
sp_cache_clear(&sp_proc_cache);
sp_cache_clear(&sp_func_cache);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment