diff options
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r-- | sql/sql_class.cc | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 4b2dee86bf3..9710ea8bbe3 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -984,8 +984,8 @@ THD::THD(my_thread_id id, bool is_wsrep_applier) &variables.wt_timeout_short, &variables.wt_deadlock_search_depth_long, &variables.wt_timeout_long); -#ifndef EMBEDDED_LIBRARY - active_mysql= 0; +#ifdef SIGNAL_WITH_VIO_CLOSE + active_vio = 0; #endif mysql_mutex_init(key_LOCK_thd_data, &LOCK_thd_data, MY_MUTEX_INIT_FAST); mysql_mutex_init(key_LOCK_wakeup_ready, &LOCK_wakeup_ready, MY_MUTEX_INIT_FAST); @@ -1687,8 +1687,8 @@ void THD::reset_for_reuse() free_connection_done= 0; m_command= COM_CONNECT; profiling.reset(); -#ifndef EMBEDDED_LIBRARY - active_mysql = 0; +#ifdef SIGNAL_WITH_VIO_CLOSE + active_vio = 0; #endif } @@ -1905,17 +1905,13 @@ void THD::awake(killed_state state_to_set) if (state_to_set >= KILL_CONNECTION || state_to_set == NOT_KILLED) { +#ifdef SIGNAL_WITH_VIO_CLOSE if (this != current_thd) { -#ifndef EMBEDDED_LIBRARY - if (active_mysql) - mysql_cancel(active_mysql); - else -#endif - if(net.vio) - vio_shutdown(net.vio, SHUT_RDWR); - + if(active_vio) + vio_shutdown(active_vio, SHUT_RDWR); } +#endif /* Mark the target thread's alarm request expired, and signal alarm. */ thr_alarm_kill(thread_id); @@ -2010,13 +2006,15 @@ void THD::disconnect() killed= KILL_CONNECTION; +#ifdef SIGNAL_WITH_VIO_CLOSE /* Since a active vio might might have not been set yet, in any case save a reference to avoid closing a inexistent one or closing the vio twice if there is a active one. */ - close_active_mysql(); - + vio= active_vio; + close_active_vio(); +#endif /* Disconnect even if a active vio is not associated. */ if (net.vio != vio) @@ -2679,19 +2677,21 @@ void THD::make_explain_field_list(List<Item> &field_list, uint8 explain_flags, } -void THD::close_active_mysql() +#ifdef SIGNAL_WITH_VIO_CLOSE +void THD::close_active_vio() { - DBUG_ENTER("close_active_mysql"); + DBUG_ENTER("close_active_vio"); mysql_mutex_assert_owner(&LOCK_thd_data); #ifndef EMBEDDED_LIBRARY - if (active_mysql) + if (active_vio) { - mysql_close(active_mysql); - active_mysql= 0; + vio_close(active_vio); + active_vio = 0; } #endif DBUG_VOID_RETURN; } +#endif struct Item_change_record: public ilink |