summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2016-08-19 15:27:37 +0000
committerVladislav Vaintroub <wlad@mariadb.com>2016-08-19 15:27:37 +0000
commit7b89b9f5108c80f4f270da922d7e6c182a663719 (patch)
tree858a3873942f07610fb26685781e8bdbd3ab2c7f /sql/sql_class.cc
parentdaff133ddf9a9d120050703c0b5753979c6190e0 (diff)
downloadmariadb-git-7b89b9f5108c80f4f270da922d7e6c182a663719.tar.gz
MDEV-9293 Connector/C integration
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc38
1 files changed, 19 insertions, 19 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 9710ea8bbe3..4b2dee86bf3 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);
-#ifdef SIGNAL_WITH_VIO_CLOSE
- active_vio = 0;
+#ifndef EMBEDDED_LIBRARY
+ active_mysql= 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();
-#ifdef SIGNAL_WITH_VIO_CLOSE
- active_vio = 0;
+#ifndef EMBEDDED_LIBRARY
+ active_mysql = 0;
#endif
}
@@ -1905,13 +1905,17 @@ 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)
{
- if(active_vio)
- vio_shutdown(active_vio, SHUT_RDWR);
- }
+#ifndef EMBEDDED_LIBRARY
+ if (active_mysql)
+ mysql_cancel(active_mysql);
+ else
#endif
+ if(net.vio)
+ vio_shutdown(net.vio, SHUT_RDWR);
+
+ }
/* Mark the target thread's alarm request expired, and signal alarm. */
thr_alarm_kill(thread_id);
@@ -2006,15 +2010,13 @@ 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.
*/
- vio= active_vio;
- close_active_vio();
-#endif
+ close_active_mysql();
+
/* Disconnect even if a active vio is not associated. */
if (net.vio != vio)
@@ -2677,21 +2679,19 @@ void THD::make_explain_field_list(List<Item> &field_list, uint8 explain_flags,
}
-#ifdef SIGNAL_WITH_VIO_CLOSE
-void THD::close_active_vio()
+void THD::close_active_mysql()
{
- DBUG_ENTER("close_active_vio");
+ DBUG_ENTER("close_active_mysql");
mysql_mutex_assert_owner(&LOCK_thd_data);
#ifndef EMBEDDED_LIBRARY
- if (active_vio)
+ if (active_mysql)
{
- vio_close(active_vio);
- active_vio = 0;
+ mysql_close(active_mysql);
+ active_mysql= 0;
}
#endif
DBUG_VOID_RETURN;
}
-#endif
struct Item_change_record: public ilink