1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

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
This commit is contained in:
sasha@mysql.sashanet.com
2001-03-13 23:07:12 -07:00
parent 555430819d
commit 0dd0d88e8f
9 changed files with 98 additions and 57 deletions

View File

@ -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)
{