diff options
author | unknown <sasha@mysql.sashanet.com> | 2001-03-13 23:07:12 -0700 |
---|---|---|
committer | unknown <sasha@mysql.sashanet.com> | 2001-03-13 23:07:12 -0700 |
commit | 5e90d39db91cee9dd9c43e4d4442a531277a7520 (patch) | |
tree | f48a65896e8f1e426f08cceb93c8c38055216860 /sql/sql_class.h | |
parent | 8046201101960a7473b743372800eeb4227846b4 (diff) | |
download | mariadb-git-5e90d39db91cee9dd9c43e4d4442a531277a7520.tar.gz |
changed signal by fd close to signal by vio_close
added support for kill expr
fixed coredump in set @a := foo;
added testcase for user_var
added testcase for kill
sql/slave.cc:
fd -> vio
sql/sql_class.cc:
fd->vio, fixed coredump on set @a := foo;
sql/sql_class.h:
fd -> vio
sql/sql_repl.cc:
fd -> vio
sql/sql_yacc.yy:
added support for kill expr - needed this for a clean test case of kill
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r-- | sql/sql_class.h | 64 |
1 files changed, 21 insertions, 43 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h index 3fd166ebc5a..b3ab4bb947d 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -21,8 +21,6 @@ #pragma interface /* gcc class implementation */ #endif -#include <thr_alarm.h> - class Query_log_event; class Load_log_event; @@ -258,9 +256,9 @@ public: #ifndef __WIN__ sigset_t signals,block_signals; #endif -#ifdef STOP_IO_WITH_FD_CLOSE - int active_fd; - pthread_mutex_t active_fd_lock; +#ifdef SIGNAL_WITH_VIO_CLOSE + Vio* active_vio; + pthread_mutex_t active_vio_lock; #endif ulonglong next_insert_id,last_insert_id,current_insert_id; ha_rows select_limit,offset_limit,default_select_limit,cuted_fields, @@ -285,59 +283,39 @@ public: // each thread that is using LOG_INFO needs to adjust the pointer to it ulong slave_proxy_id; // in slave thread we need to know in behalf of which - // thread the query is being run to replicate temp tables properly + // thread the query is being run to replicate temp tables properly // thread-specific state map for lex parser uchar state_map[256]; - + THD(); ~THD(); bool store_globals(); -#ifdef STOP_IO_WITH_FD_CLOSE - inline void set_active_fd(int fd) +#ifdef SIGNAL_WITH_VIO_CLOSE + inline void set_active_vio(Vio* vio) { - pthread_mutex_lock(&active_fd_lock); - active_fd = fd; - pthread_mutex_unlock(&active_fd_lock); + pthread_mutex_lock(&active_vio_lock); + active_vio = vio; + pthread_mutex_unlock(&active_vio_lock); } - inline void clear_active_fd() + inline void clear_active_vio() { - pthread_mutex_lock(&active_fd_lock); - active_fd = -1; - pthread_mutex_unlock(&active_fd_lock); + pthread_mutex_lock(&active_vio_lock); + active_vio = 0; + pthread_mutex_unlock(&active_vio_lock); } - inline void close_active_fd() + inline void close_active_vio() { - pthread_mutex_lock(&active_fd_lock); - if(active_fd >= 0) + pthread_mutex_lock(&active_vio_lock); + if(active_vio) { - my_close(active_fd, MYF(MY_WME)); - active_fd = -1; + vio_close(active_vio); + active_vio = 0; } - pthread_mutex_unlock(&active_fd_lock); + pthread_mutex_unlock(&active_vio_lock); } #endif - inline void prepare_to_die() - { - thr_alarm_kill(real_id); - killed = 1; -#ifdef STOP_IO_WITH_FD_CLOSE - close_active_fd(); -#endif - if (mysys_var) - { - pthread_mutex_lock(&mysys_var->mutex); - if (!system_thread) // Don't abort locks - mysys_var->abort=1; - if (mysys_var->current_mutex) - { - pthread_mutex_lock(mysys_var->current_mutex); - pthread_cond_broadcast(mysys_var->current_cond); - pthread_mutex_unlock(mysys_var->current_mutex); - } - pthread_mutex_unlock(&mysys_var->mutex); - } - } + void prepare_to_die(); inline const char* enter_cond(pthread_cond_t *cond, pthread_mutex_t* mutex, const char* msg) { |