Commit 4dcaa978 authored by Ramil Kalimullin's avatar Ramil Kalimullin

Automerge

parents 1aec6f7a 1cf02d95
......@@ -2,12 +2,5 @@ funcs_1.charset_collation_1 # depends on compile-time decisions
binlog.binlog_tmp_table # Bug#45578: Test binlog_tmp_table fails ramdonly on PB2: Unknown table 't2'
main.ctype_gbk_binlog # Bug#46010: main.ctype_gbk_binlog fails sporadically : Table 't2' already exists
rpl.rpl_row_create_table # Bug#45576: rpl_row_create_table fails on PB2
rpl.rpl_extraColmaster_myisam # Bug#46013: rpl_extraColmaster_myisam fails on pb2
rpl.rpl_stm_reset_slave # Bug#46014: rpl_stm_reset_slave crashes the server sporadically in pb2
rpl.rpl_extraCol_myisam # Bug#40796
rpl.rpl_extraColmaster_innodb # Bug#40796
rpl.rpl_extraCol_innodb # Bug#40796
rpl_ndb.rpl_ndb_log # Bug#38998
rpl.rpl_innodb_bug28430 # Bug#46029
rpl.rpl_row_basic_3innodb # Bug#45243
rpl.rpl_truncate_3innodb # Bug#46030
......@@ -70,6 +70,18 @@ void my_net_local_init(NET *net)
C_MODE_END
/*
Unused stub hook required for linking the client API.
*/
C_MODE_START
void slave_io_thread_detach_vio()
{
}
C_MODE_END
/*
Every resource, which we can fail to acquire, is allocated in init().
......
......@@ -933,6 +933,9 @@ void end_server(MYSQL *mysql)
{
init_sigpipe_variables
DBUG_PRINT("info",("Net: %s", vio_description(mysql->net.vio)));
#ifdef MYSQL_SERVER
slave_io_thread_detach_vio();
#endif
set_sigpipe(mysql);
vio_delete(mysql->net.vio);
reset_sigpipe(mysql);
......
......@@ -33,3 +33,11 @@
#define mysql_server_init(a,b,c) 0
#ifdef HAVE_REPLICATION
C_MODE_START
void slave_io_thread_detach_vio();
C_MODE_END
#else
#define slave_io_thread_detach_vio()
#endif
......@@ -3738,6 +3738,31 @@ void end_relay_log_info(Relay_log_info* rli)
DBUG_VOID_RETURN;
}
/**
Hook to detach the active VIO before closing a connection handle.
The client API might close the connection (and associated data)
in case it encounters a unrecoverable (network) error. This hook
is called from the client code before the VIO handle is deleted
allows the thread to detach the active vio so it does not point
to freed memory.
Other calls to THD::clear_active_vio throughout this module are
redundant due to the hook but are left in place for illustrative
purposes.
*/
extern "C" void slave_io_thread_detach_vio()
{
#ifdef SIGNAL_WITH_VIO_CLOSE
THD *thd= current_thd;
if (thd->slave_thread)
thd->clear_active_vio();
#endif
}
/*
Try to connect until successful or slave killed
......
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