Commit f4422bd4 authored by unknown's avatar unknown

Merge trift-lap.fambruehe:/MySQL/M51/mysql-5.1

into  trift-lap.fambruehe:/MySQL/M51/push-5.1


client/Makefile.am:
  Auto merged
parents e3d3f302 53b9d044
...@@ -147,6 +147,28 @@ test-force-full: ...@@ -147,6 +147,28 @@ test-force-full:
test-force-mem: test-force-mem:
$(MAKE) force=--force mem=--mem test $(MAKE) force=--force mem=--mem test
test-bt:
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --comment=normal --force --timer \
--skip-ndbcluster --report-features
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --comment=ps --force --timer \
--skip-ndbcluster --ps-protocol
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --comment=normal+rowrepl --force --timer \
--skip-ndbcluster --mysqld=--binlog-format=row
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --comment=ps+rowrepl+NDB --force --timer \
--ps-protocol --mysqld=--binlog-format=row
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --comment=NDB --force --timer \
--with-ndbcluster-only
test-bt-debug:
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --comment=debug --force --timer \
--skip-ndbcluster --skip-rpl --report-features
# Keep these for a while # Keep these for a while
test-pl: test test-pl: test
test-full-pl: test-full test-full-pl: test-full
......
...@@ -34,7 +34,7 @@ LDADD= @CLIENT_EXTRA_LDFLAGS@ $(CLIENT_THREAD_LIBS) \ ...@@ -34,7 +34,7 @@ LDADD= @CLIENT_EXTRA_LDFLAGS@ $(CLIENT_THREAD_LIBS) \
noinst_HEADERS = sql_string.h completion_hash.h my_readline.h \ noinst_HEADERS = sql_string.h completion_hash.h my_readline.h \
client_priv.h client_priv.h
EXTRA_DIST = get_password.c CMakeLists.txt EXTRA_DIST = get_password.c CMakeLists.txt echo.c
bin_PROGRAMS = mysql \ bin_PROGRAMS = mysql \
mysqladmin \ mysqladmin \
...@@ -97,7 +97,6 @@ DEFS = -DUNDEF_THREADS_HACK \ ...@@ -97,7 +97,6 @@ DEFS = -DUNDEF_THREADS_HACK \
sql_src=log_event.h mysql_priv.h log_event.cc my_decimal.h my_decimal.cc sql_src=log_event.h mysql_priv.h log_event.cc my_decimal.h my_decimal.cc
strings_src=decimal.c strings_src=decimal.c
EXTRA_DIST = get_password.c CMakeLists.txt echo.c
link_sources: link_sources:
for f in $(sql_src) ; do \ for f in $(sql_src) ; do \
......
...@@ -2296,12 +2296,18 @@ AC_ARG_WITH(man, ...@@ -2296,12 +2296,18 @@ AC_ARG_WITH(man,
[with_man=yes] [with_man=yes]
) )
if test "$with_man" = "yes" if test X"$with_man" = Xyes
then then
man_dirs="man" man_dirs="man"
man1_files=`ls -1 $srcdir/man/*.1 | sed -e 's;^.*man/;;'` if test X"$have_ndbcluster" = Xyes
then
man1_files=`ls $srcdir/man/*.1 | sed -e 's;^.*man/;;'`
man8_files=`ls $srcdir/man/*.8 | sed -e 's;^.*man/;;'`
else
man1_files=`ls $srcdir/man/*.1 | grep -v '/ndb' | sed -e 's;^.*man/;;'`
man8_files=`ls $srcdir/man/*.8 | grep -v '/ndb' | sed -e 's;^.*man/;;'`
fi
man1_files=`echo $man1_files` man1_files=`echo $man1_files`
man8_files=`ls -1 $srcdir/man/*.8 | sed -e 's;^.*man/;;'`
man8_files=`echo $man8_files` man8_files=`echo $man8_files`
else else
man_dirs="" man_dirs=""
......
...@@ -425,14 +425,8 @@ inline double ulonglong2double(ulonglong value) ...@@ -425,14 +425,8 @@ inline double ulonglong2double(ulonglong value)
#define shared_memory_buffer_length 16000 #define shared_memory_buffer_length 16000
#define default_shared_memory_base_name "MYSQL" #define default_shared_memory_base_name "MYSQL"
#ifdef CYBOZU
#define MYSQL_DEFAULT_CHARSET_NAME "utf8"
#define MYSQL_DEFAULT_COLLATION_NAME "utf8_general_cs"
#define HAVE_UTF8_GENERAL_CS 1
#else
#define MYSQL_DEFAULT_CHARSET_NAME "latin1" #define MYSQL_DEFAULT_CHARSET_NAME "latin1"
#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci" #define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci"
#endif
#define HAVE_SPATIAL 1 #define HAVE_SPATIAL 1
#define HAVE_RTREE_KEYS 1 #define HAVE_RTREE_KEYS 1
...@@ -443,10 +437,8 @@ inline double ulonglong2double(ulonglong value) ...@@ -443,10 +437,8 @@ inline double ulonglong2double(ulonglong value)
/* Define charsets you want */ /* Define charsets you want */
/* #undef HAVE_CHARSET_armscii8 */ /* #undef HAVE_CHARSET_armscii8 */
/* #undef HAVE_CHARSET_ascii */ /* #undef HAVE_CHARSET_ascii */
#ifndef CYBOZU
#define HAVE_CHARSET_big5 1 #define HAVE_CHARSET_big5 1
#define HAVE_CHARSET_cp1250 1 #define HAVE_CHARSET_cp1250 1
#endif
/* #undef HAVE_CHARSET_cp1251 */ /* #undef HAVE_CHARSET_cp1251 */
/* #undef HAVE_CHARSET_cp1256 */ /* #undef HAVE_CHARSET_cp1256 */
/* #undef HAVE_CHARSET_cp1257 */ /* #undef HAVE_CHARSET_cp1257 */
...@@ -455,33 +447,27 @@ inline double ulonglong2double(ulonglong value) ...@@ -455,33 +447,27 @@ inline double ulonglong2double(ulonglong value)
/* #undef HAVE_CHARSET_cp866 */ /* #undef HAVE_CHARSET_cp866 */
#define HAVE_CHARSET_cp932 1 #define HAVE_CHARSET_cp932 1
/* #undef HAVE_CHARSET_dec8 */ /* #undef HAVE_CHARSET_dec8 */
#ifndef CYBOZU
#define HAVE_CHARSET_eucjpms 1 #define HAVE_CHARSET_eucjpms 1
#define HAVE_CHARSET_euckr 1 #define HAVE_CHARSET_euckr 1
#define HAVE_CHARSET_gb2312 1 #define HAVE_CHARSET_gb2312 1
#define HAVE_CHARSET_gbk 1 #define HAVE_CHARSET_gbk 1
#endif
/* #undef HAVE_CHARSET_greek */ /* #undef HAVE_CHARSET_greek */
/* #undef HAVE_CHARSET_hebrew */ /* #undef HAVE_CHARSET_hebrew */
/* #undef HAVE_CHARSET_hp8 */ /* #undef HAVE_CHARSET_hp8 */
/* #undef HAVE_CHARSET_keybcs2 */ /* #undef HAVE_CHARSET_keybcs2 */
/* #undef HAVE_CHARSET_koi8r */ /* #undef HAVE_CHARSET_koi8r */
/* #undef HAVE_CHARSET_koi8u */ /* #undef HAVE_CHARSET_koi8u */
#ifndef CYBOZU
#define HAVE_CHARSET_latin1 1 #define HAVE_CHARSET_latin1 1
#define HAVE_CHARSET_latin2 1 #define HAVE_CHARSET_latin2 1
#endif
/* #undef HAVE_CHARSET_latin5 */ /* #undef HAVE_CHARSET_latin5 */
/* #undef HAVE_CHARSET_latin7 */ /* #undef HAVE_CHARSET_latin7 */
/* #undef HAVE_CHARSET_macce */ /* #undef HAVE_CHARSET_macce */
/* #undef HAVE_CHARSET_macroman */ /* #undef HAVE_CHARSET_macroman */
#define HAVE_CHARSET_sjis 1 #define HAVE_CHARSET_sjis 1
/* #undef HAVE_CHARSET_swe7 */ /* #undef HAVE_CHARSET_swe7 */
#ifndef CYBOZU
#define HAVE_CHARSET_tis620 1 #define HAVE_CHARSET_tis620 1
#define HAVE_CHARSET_ucs2 1 #define HAVE_CHARSET_ucs2 1
#define HAVE_CHARSET_ujis 1 #define HAVE_CHARSET_ujis 1
#endif
#define HAVE_CHARSET_utf8 1 #define HAVE_CHARSET_utf8 1
#define HAVE_UCA_COLLATIONS 1 #define HAVE_UCA_COLLATIONS 1
...@@ -701,6 +701,15 @@ extern uint my_thread_end_wait_time; ...@@ -701,6 +701,15 @@ extern uint my_thread_end_wait_time;
Keep track of shutdown,signal, and main threads so that my_end() will not Keep track of shutdown,signal, and main threads so that my_end() will not
report errors with them report errors with them
*/ */
/* Which kind of thread library is in use */
#define THD_LIB_OTHER 1
#define THD_LIB_NPTL 2
#define THD_LIB_LT 4
extern uint thd_lib_detected;
/* statistics_xxx functions are for not essential statistic */ /* statistics_xxx functions are for not essential statistic */
#ifndef thread_safe_increment #ifndef thread_safe_increment
......
...@@ -24,11 +24,6 @@ extern "C" { ...@@ -24,11 +24,6 @@ extern "C" {
#ifndef USE_ALARM_THREAD #ifndef USE_ALARM_THREAD
#define USE_ONE_SIGNAL_HAND /* One must call process_alarm */ #define USE_ONE_SIGNAL_HAND /* One must call process_alarm */
#endif #endif
#ifdef HAVE_LINUXTHREADS
#define THR_CLIENT_ALARM SIGALRM
#else
#define THR_CLIENT_ALARM SIGUSR1
#endif
#ifdef HAVE_rts_threads #ifdef HAVE_rts_threads
#undef USE_ONE_SIGNAL_HAND #undef USE_ONE_SIGNAL_HAND
#define USE_ALARM_THREAD #define USE_ALARM_THREAD
...@@ -90,6 +85,9 @@ typedef struct st_alarm { ...@@ -90,6 +85,9 @@ typedef struct st_alarm {
my_bool malloced; my_bool malloced;
} ALARM; } ALARM;
extern uint thr_client_alarm;
extern pthread_t alarm_thread;
#define thr_alarm_init(A) (*(A))=0 #define thr_alarm_init(A) (*(A))=0
#define thr_alarm_in_use(A) (*(A)!= 0) #define thr_alarm_in_use(A) (*(A)!= 0)
void init_thr_alarm(uint max_alarm); void init_thr_alarm(uint max_alarm);
......
...@@ -61,7 +61,7 @@ fi ...@@ -61,7 +61,7 @@ fi
########################################################################### ###########################################################################
client_args="--silent --socket=$socket_path --connect_timeout=1 " client_args="--no-defaults --silent --socket=$socket_path --connect_timeout=1 "
[ -n "$username" ] && client_args="$client_args --user=$username " [ -n "$username" ] && client_args="$client_args --user=$username "
[ -n "$password" ] && client_args="$client_args --password=$password " [ -n "$password" ] && client_args="$client_args --password=$password "
......
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
uint thd_lib_detected= 0; uint thd_lib_detected= 0;
uint thd_lib_detected;
#ifndef my_pthread_setprio #ifndef my_pthread_setprio
void my_pthread_setprio(pthread_t thread_id,int prior) void my_pthread_setprio(pthread_t thread_id,int prior)
{ {
...@@ -51,8 +53,6 @@ int my_pthread_getprio(pthread_t thread_id) ...@@ -51,8 +53,6 @@ int my_pthread_getprio(pthread_t thread_id)
int policy; int policy;
if (!pthread_getschedparam(thread_id,&policy,&tmp_sched_param)) if (!pthread_getschedparam(thread_id,&policy,&tmp_sched_param))
{ {
DBUG_PRINT("thread",("policy: %d priority: %d",
policy,tmp_sched_param.sched_priority));
return tmp_sched_param.sched_priority; return tmp_sched_param.sched_priority;
} }
#endif #endif
...@@ -314,8 +314,6 @@ void sigwait_handle_sig(int sig) ...@@ -314,8 +314,6 @@ void sigwait_handle_sig(int sig)
pthread_mutex_unlock(&LOCK_sigwait); pthread_mutex_unlock(&LOCK_sigwait);
} }
extern pthread_t alarm_thread;
void *sigwait_thread(void *set_arg) void *sigwait_thread(void *set_arg)
{ {
sigset_t *set=(sigset_t*) set_arg; sigset_t *set=(sigset_t*) set_arg;
...@@ -334,7 +332,9 @@ void *sigwait_thread(void *set_arg) ...@@ -334,7 +332,9 @@ void *sigwait_thread(void *set_arg)
sigaction(i, &sact, (struct sigaction*) 0); sigaction(i, &sact, (struct sigaction*) 0);
} }
} }
sigaddset(set,THR_CLIENT_ALARM); /* Ensure that init_thr_alarm() is called */
DBUG_ASSERT(thr_client_alarm);
sigaddset(set, thr_client_alarm);
pthread_sigmask(SIG_UNBLOCK,(sigset_t*) set,(sigset_t*) 0); pthread_sigmask(SIG_UNBLOCK,(sigset_t*) set,(sigset_t*) 0);
alarm_thread=pthread_self(); /* For thr_alarm */ alarm_thread=pthread_self(); /* For thr_alarm */
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "mysys_priv.h" #include "mysys_priv.h"
#include <m_string.h> #include <m_string.h>
#include <signal.h>
#ifdef THREAD #ifdef THREAD
#ifdef USE_TLS #ifdef USE_TLS
...@@ -63,6 +64,8 @@ nptl_pthread_exit_hack_handler(void *arg __attribute((unused))) ...@@ -63,6 +64,8 @@ nptl_pthread_exit_hack_handler(void *arg __attribute((unused)))
#endif #endif
static uint get_thread_lib(void);
/* /*
initialize thread environment initialize thread environment
...@@ -76,6 +79,8 @@ nptl_pthread_exit_hack_handler(void *arg __attribute((unused))) ...@@ -76,6 +79,8 @@ nptl_pthread_exit_hack_handler(void *arg __attribute((unused)))
my_bool my_thread_global_init(void) my_bool my_thread_global_init(void)
{ {
thd_lib_detected= get_thread_lib();
if (pthread_key_create(&THR_KEY_mysys,0)) if (pthread_key_create(&THR_KEY_mysys,0))
{ {
fprintf(stderr,"Can't initialize threads: error %d\n",errno); fprintf(stderr,"Can't initialize threads: error %d\n",errno);
...@@ -395,4 +400,20 @@ const char *my_thread_name(void) ...@@ -395,4 +400,20 @@ const char *my_thread_name(void)
} }
#endif /* DBUG_OFF */ #endif /* DBUG_OFF */
static uint get_thread_lib(void)
{
#ifdef _CS_GNU_LIBPTHREAD_VERSION
char buff[64];
confstr(_CS_GNU_LIBPTHREAD_VERSION, buff, sizeof(buff));
if (!strncasecmp(buff, "NPTL", 4))
return THD_LIB_NPTL;
if (!strncasecmp(buff, "linuxthreads", 12))
return THD_LIB_LT;
#endif
return THD_LIB_OTHER;
}
#endif /* THREAD */ #endif /* THREAD */
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#define ETIME ETIMEDOUT #define ETIME ETIMEDOUT
#endif #endif
uint thr_client_alarm;
static int alarm_aborted=1; /* No alarm thread */ static int alarm_aborted=1; /* No alarm thread */
my_bool thr_alarm_inited= 0; my_bool thr_alarm_inited= 0;
volatile my_bool alarm_thread_running= 0; volatile my_bool alarm_thread_running= 0;
...@@ -56,9 +57,7 @@ static void *alarm_handler(void *arg); ...@@ -56,9 +57,7 @@ static void *alarm_handler(void *arg);
#define reschedule_alarms() pthread_kill(alarm_thread,THR_SERVER_ALARM) #define reschedule_alarms() pthread_kill(alarm_thread,THR_SERVER_ALARM)
#endif #endif
#if THR_CLIENT_ALARM != SIGALRM || defined(USE_ALARM_THREAD)
static sig_handler thread_alarm(int sig __attribute__((unused))); static sig_handler thread_alarm(int sig __attribute__((unused)));
#endif
static int compare_ulong(void *not_used __attribute__((unused)), static int compare_ulong(void *not_used __attribute__((unused)),
byte *a_ptr,byte* b_ptr) byte *a_ptr,byte* b_ptr)
...@@ -77,9 +76,13 @@ void init_thr_alarm(uint max_alarms) ...@@ -77,9 +76,13 @@ void init_thr_alarm(uint max_alarms)
sigfillset(&full_signal_set); /* Neaded to block signals */ sigfillset(&full_signal_set); /* Neaded to block signals */
pthread_mutex_init(&LOCK_alarm,MY_MUTEX_INIT_FAST); pthread_mutex_init(&LOCK_alarm,MY_MUTEX_INIT_FAST);
pthread_cond_init(&COND_alarm,NULL); pthread_cond_init(&COND_alarm,NULL);
#if THR_CLIENT_ALARM != SIGALRM || defined(USE_ALARM_THREAD) thr_client_alarm= thd_lib_detected == THD_LIB_LT ? SIGALRM : SIGUSR1;
my_sigset(THR_CLIENT_ALARM,thread_alarm); #ifndef USE_ALARM_THREAD
if (thd_lib_detected != THD_LIB_LT)
#endif #endif
{
my_sigset(thr_client_alarm, thread_alarm);
}
sigemptyset(&s); sigemptyset(&s);
sigaddset(&s, THR_SERVER_ALARM); sigaddset(&s, THR_SERVER_ALARM);
alarm_thread=pthread_self(); alarm_thread=pthread_self();
...@@ -97,10 +100,11 @@ void init_thr_alarm(uint max_alarms) ...@@ -97,10 +100,11 @@ void init_thr_alarm(uint max_alarms)
} }
#elif defined(USE_ONE_SIGNAL_HAND) #elif defined(USE_ONE_SIGNAL_HAND)
pthread_sigmask(SIG_BLOCK, &s, NULL); /* used with sigwait() */ pthread_sigmask(SIG_BLOCK, &s, NULL); /* used with sigwait() */
#if THR_SERVER_ALARM == THR_CLIENT_ALARM if (thd_lib_detected == THD_LIB_LT)
my_sigset(THR_CLIENT_ALARM,process_alarm); /* Linuxthreads */ {
my_sigset(thr_client_alarm, process_alarm); /* Linuxthreads */
pthread_sigmask(SIG_UNBLOCK, &s, NULL); pthread_sigmask(SIG_UNBLOCK, &s, NULL);
#endif }
#else #else
my_sigset(THR_SERVER_ALARM, process_alarm); my_sigset(THR_SERVER_ALARM, process_alarm);
pthread_sigmask(SIG_UNBLOCK, &s, NULL); pthread_sigmask(SIG_UNBLOCK, &s, NULL);
...@@ -273,18 +277,17 @@ sig_handler process_alarm(int sig __attribute__((unused))) ...@@ -273,18 +277,17 @@ sig_handler process_alarm(int sig __attribute__((unused)))
This must be first as we can't call DBUG inside an alarm for a normal thread This must be first as we can't call DBUG inside an alarm for a normal thread
*/ */
#if THR_SERVER_ALARM == THR_CLIENT_ALARM if (thd_lib_detected == THD_LIB_LT &&
if (!pthread_equal(pthread_self(),alarm_thread)) !pthread_equal(pthread_self(),alarm_thread))
{ {
#if defined(MAIN) && !defined(__bsdi__) #if defined(MAIN) && !defined(__bsdi__)
printf("thread_alarm in process_alarm\n"); fflush(stdout); printf("thread_alarm in process_alarm\n"); fflush(stdout);
#endif #endif
#ifdef DONT_REMEMBER_SIGNAL #ifdef DONT_REMEMBER_SIGNAL
my_sigset(THR_CLIENT_ALARM,process_alarm); /* int. thread system calls */ my_sigset(thr_client_alarm, process_alarm); /* int. thread system calls */
#endif #endif
return; return;
} }
#endif
/* /*
We have to do do the handling of the alarm in a sub function, We have to do do the handling of the alarm in a sub function,
...@@ -328,7 +331,7 @@ static sig_handler process_alarm_part2(int sig __attribute__((unused))) ...@@ -328,7 +331,7 @@ static sig_handler process_alarm_part2(int sig __attribute__((unused)))
alarm_data=(ALARM*) queue_element(&alarm_queue,i); alarm_data=(ALARM*) queue_element(&alarm_queue,i);
alarm_data->alarmed=1; /* Info to thread */ alarm_data->alarmed=1; /* Info to thread */
if (pthread_equal(alarm_data->thread,alarm_thread) || if (pthread_equal(alarm_data->thread,alarm_thread) ||
pthread_kill(alarm_data->thread, THR_CLIENT_ALARM)) pthread_kill(alarm_data->thread, thr_client_alarm))
{ {
#ifdef MAIN #ifdef MAIN
printf("Warning: pthread_kill couldn't find thread!!!\n"); printf("Warning: pthread_kill couldn't find thread!!!\n");
...@@ -352,7 +355,7 @@ static sig_handler process_alarm_part2(int sig __attribute__((unused))) ...@@ -352,7 +355,7 @@ static sig_handler process_alarm_part2(int sig __attribute__((unused)))
alarm_data->alarmed=1; /* Info to thread */ alarm_data->alarmed=1; /* Info to thread */
DBUG_PRINT("info",("sending signal to waiting thread")); DBUG_PRINT("info",("sending signal to waiting thread"));
if (pthread_equal(alarm_data->thread,alarm_thread) || if (pthread_equal(alarm_data->thread,alarm_thread) ||
pthread_kill(alarm_data->thread, THR_CLIENT_ALARM)) pthread_kill(alarm_data->thread, thr_client_alarm))
{ {
#ifdef MAIN #ifdef MAIN
printf("Warning: pthread_kill couldn't find thread!!!\n"); printf("Warning: pthread_kill couldn't find thread!!!\n");
...@@ -488,7 +491,7 @@ void thr_alarm_info(ALARM_INFO *info) ...@@ -488,7 +491,7 @@ void thr_alarm_info(ALARM_INFO *info)
ARGSUSED ARGSUSED
*/ */
#if THR_CLIENT_ALARM != SIGALRM || defined(USE_ALARM_THREAD)
static sig_handler thread_alarm(int sig) static sig_handler thread_alarm(int sig)
{ {
#ifdef MAIN #ifdef MAIN
...@@ -498,7 +501,6 @@ static sig_handler thread_alarm(int sig) ...@@ -498,7 +501,6 @@ static sig_handler thread_alarm(int sig)
my_sigset(sig,thread_alarm); /* int. thread system calls */ my_sigset(sig,thread_alarm); /* int. thread system calls */
#endif #endif
} }
#endif
#ifdef HAVE_TIMESPEC_TS_SEC #ifdef HAVE_TIMESPEC_TS_SEC
...@@ -784,9 +786,7 @@ static void *signal_hand(void *arg __attribute__((unused))) ...@@ -784,9 +786,7 @@ static void *signal_hand(void *arg __attribute__((unused)))
sigaddset(&set,SIGINT); sigaddset(&set,SIGINT);
sigaddset(&set,SIGQUIT); sigaddset(&set,SIGQUIT);
sigaddset(&set,SIGTERM); sigaddset(&set,SIGTERM);
#if THR_CLIENT_ALARM != SIGHUP
sigaddset(&set,SIGHUP); sigaddset(&set,SIGHUP);
#endif
#ifdef SIGTSTP #ifdef SIGTSTP
sigaddset(&set,SIGTSTP); sigaddset(&set,SIGTSTP);
#endif #endif
...@@ -797,7 +797,7 @@ static void *signal_hand(void *arg __attribute__((unused))) ...@@ -797,7 +797,7 @@ static void *signal_hand(void *arg __attribute__((unused)))
puts("Starting signal handling thread"); puts("Starting signal handling thread");
#endif #endif
printf("server alarm: %d thread alarm: %d\n", printf("server alarm: %d thread alarm: %d\n",
THR_SERVER_ALARM,THR_CLIENT_ALARM); THR_SERVER_ALARM, thr_client_alarm);
DBUG_PRINT("info",("Starting signal and alarm handling thread")); DBUG_PRINT("info",("Starting signal and alarm handling thread"));
for(;;) for(;;)
{ {
...@@ -865,11 +865,11 @@ int main(int argc __attribute__((unused)),char **argv __attribute__((unused))) ...@@ -865,11 +865,11 @@ int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
sigaddset(&set,SIGTSTP); sigaddset(&set,SIGTSTP);
#endif #endif
sigaddset(&set,THR_SERVER_ALARM); sigaddset(&set,THR_SERVER_ALARM);
sigdelset(&set,THR_CLIENT_ALARM); sigdelset(&set, thr_client_alarm);
(void) pthread_sigmask(SIG_SETMASK,&set,NULL); (void) pthread_sigmask(SIG_SETMASK,&set,NULL);
#ifdef NOT_USED #ifdef NOT_USED
sigemptyset(&set); sigemptyset(&set);
sigaddset(&set,THR_CLIENT_ALARM); sigaddset(&set, thr_client_alarm);
VOID(pthread_sigmask(SIG_UNBLOCK, &set, (sigset_t*) 0)); VOID(pthread_sigmask(SIG_UNBLOCK, &set, (sigset_t*) 0));
#endif #endif
......
...@@ -195,12 +195,6 @@ inline void reset_floating_point_exceptions() ...@@ -195,12 +195,6 @@ inline void reset_floating_point_exceptions()
} /* cplusplus */ } /* cplusplus */
#if defined(HAVE_LINUXTHREADS)
#define THR_KILL_SIGNAL SIGINT
#else
#define THR_KILL_SIGNAL SIGUSR2 // Can't use this with LinuxThreads
#endif
#define MYSQL_KILL_SIGNAL SIGTERM #define MYSQL_KILL_SIGNAL SIGTERM
#ifdef HAVE_GLIBC2_STYLE_GETHOSTBYNAME_R #ifdef HAVE_GLIBC2_STYLE_GETHOSTBYNAME_R
...@@ -638,6 +632,7 @@ struct rand_struct sql_rand; // used by sql_class.cc:THD::THD() ...@@ -638,6 +632,7 @@ struct rand_struct sql_rand; // used by sql_class.cc:THD::THD()
#ifndef EMBEDDED_LIBRARY #ifndef EMBEDDED_LIBRARY
struct passwd *user_info; struct passwd *user_info;
static pthread_t select_thread; static pthread_t select_thread;
static uint thr_kill_signal;
#endif #endif
/* OS specific variables */ /* OS specific variables */
...@@ -788,7 +783,7 @@ static void close_connections(void) ...@@ -788,7 +783,7 @@ static void close_connections(void)
DBUG_PRINT("info",("Waiting for select thread")); DBUG_PRINT("info",("Waiting for select thread"));
#ifndef DONT_USE_THR_ALARM #ifndef DONT_USE_THR_ALARM
if (pthread_kill(select_thread,THR_CLIENT_ALARM)) if (pthread_kill(select_thread, thr_client_alarm))
break; // allready dead break; // allready dead
#endif #endif
set_timespec(abstime, 2); set_timespec(abstime, 2);
...@@ -2294,7 +2289,9 @@ static void init_signals(void) ...@@ -2294,7 +2289,9 @@ static void init_signals(void)
DBUG_ENTER("init_signals"); DBUG_ENTER("init_signals");
if (test_flags & TEST_SIGINT) if (test_flags & TEST_SIGINT)
my_sigset(THR_KILL_SIGNAL,end_thread_signal); {
my_sigset(thr_kill_signal, end_thread_signal);
}
my_sigset(THR_SERVER_ALARM,print_signal_warning); // Should never be called! my_sigset(THR_SERVER_ALARM,print_signal_warning); // Should never be called!
if (!(test_flags & TEST_NO_STACKTRACE) || (test_flags & TEST_CORE_ON_SIGNAL)) if (!(test_flags & TEST_NO_STACKTRACE) || (test_flags & TEST_CORE_ON_SIGNAL))
...@@ -2349,10 +2346,13 @@ static void init_signals(void) ...@@ -2349,10 +2346,13 @@ static void init_signals(void)
#ifdef SIGTSTP #ifdef SIGTSTP
sigaddset(&set,SIGTSTP); sigaddset(&set,SIGTSTP);
#endif #endif
if (thd_lib_detected != THD_LIB_LT)
sigaddset(&set,THR_SERVER_ALARM); sigaddset(&set,THR_SERVER_ALARM);
if (test_flags & TEST_SIGINT) if (test_flags & TEST_SIGINT)
sigdelset(&set,THR_KILL_SIGNAL); // May be SIGINT {
sigdelset(&set,THR_CLIENT_ALARM); // For alarms // May be SIGINT
sigdelset(&set, thr_kill_signal);
}
sigprocmask(SIG_SETMASK,&set,NULL); sigprocmask(SIG_SETMASK,&set,NULL);
pthread_sigmask(SIG_SETMASK,&set,NULL); pthread_sigmask(SIG_SETMASK,&set,NULL);
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
...@@ -2415,23 +2415,19 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused))) ...@@ -2415,23 +2415,19 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused)))
*/ */
init_thr_alarm(thread_scheduler.max_threads + init_thr_alarm(thread_scheduler.max_threads +
global_system_variables.max_insert_delayed_threads + 10); global_system_variables.max_insert_delayed_threads + 10);
#if SIGINT != THR_KILL_SIGNAL if (thd_lib_detected != THD_LIB_LT && (test_flags & TEST_SIGINT))
if (test_flags & TEST_SIGINT)
{ {
(void) sigemptyset(&set); // Setup up SIGINT for debug (void) sigemptyset(&set); // Setup up SIGINT for debug
(void) sigaddset(&set,SIGINT); // For debugging (void) sigaddset(&set,SIGINT); // For debugging
(void) pthread_sigmask(SIG_UNBLOCK,&set,NULL); (void) pthread_sigmask(SIG_UNBLOCK,&set,NULL);
} }
#endif
(void) sigemptyset(&set); // Setup up SIGINT for debug (void) sigemptyset(&set); // Setup up SIGINT for debug
#ifdef USE_ONE_SIGNAL_HAND #ifdef USE_ONE_SIGNAL_HAND
(void) sigaddset(&set,THR_SERVER_ALARM); // For alarms (void) sigaddset(&set,THR_SERVER_ALARM); // For alarms
#endif #endif
#ifndef IGNORE_SIGHUP_SIGQUIT #ifndef IGNORE_SIGHUP_SIGQUIT
(void) sigaddset(&set,SIGQUIT); (void) sigaddset(&set,SIGQUIT);
#if THR_CLIENT_ALARM != SIGHUP
(void) sigaddset(&set,SIGHUP); (void) sigaddset(&set,SIGHUP);
#endif
#endif #endif
(void) sigaddset(&set,SIGTERM); (void) sigaddset(&set,SIGTERM);
(void) sigaddset(&set,SIGTSTP); (void) sigaddset(&set,SIGTSTP);
...@@ -3626,6 +3622,13 @@ int main(int argc, char **argv) ...@@ -3626,6 +3622,13 @@ int main(int argc, char **argv)
MY_INIT(argv[0]); // init my_sys library & pthreads MY_INIT(argv[0]); // init my_sys library & pthreads
/* nothing should come before this line ^^^ */ /* nothing should come before this line ^^^ */
/* Set signal used to kill MySQL */
#if defined(SIGUSR2)
thr_kill_signal= thd_lib_detected == THD_LIB_LT ? SIGINT : SIGUSR2;
#else
thr_kill_signal= SIGINT;
#endif
/* /*
Perform basic logger initialization logger. Should be called after Perform basic logger initialization logger. Should be called after
MY_INIT, as it initializes mutexes. Log tables are inited later. MY_INIT, as it initializes mutexes. Log tables are inited later.
......
...@@ -53,21 +53,6 @@ void safe_print_str(const char* name, const char* val, int max_len) ...@@ -53,21 +53,6 @@ void safe_print_str(const char* name, const char* val, int max_len)
#define SIGRETURN_FRAME_OFFSET 23 #define SIGRETURN_FRAME_OFFSET 23
#endif #endif
static my_bool is_nptl;
/* Check if we are using NPTL or LinuxThreads on Linux */
void check_thread_lib(void)
{
char buf[5];
#ifdef _CS_GNU_LIBPTHREAD_VERSION
confstr(_CS_GNU_LIBPTHREAD_VERSION, buf, sizeof(buf));
is_nptl = !strncasecmp(buf, "NPTL", sizeof(buf));
#else
is_nptl = 0;
#endif
}
#if defined(__alpha__) && defined(__GNUC__) #if defined(__alpha__) && defined(__GNUC__)
/* /*
The only way to backtrace without a symbol table on alpha The only way to backtrace without a symbol table on alpha
...@@ -173,7 +158,7 @@ terribly wrong...\n"); ...@@ -173,7 +158,7 @@ terribly wrong...\n");
#endif /* __alpha__ */ #endif /* __alpha__ */
/* We are 1 frame above signal frame with NPTL and 2 frames above with LT */ /* We are 1 frame above signal frame with NPTL and 2 frames above with LT */
sigreturn_frame_count = is_nptl ? 1 : 2; sigreturn_frame_count = thd_lib_detected == THD_LIB_LT ? 2 : 1;
while (fp < (uchar**) stack_bottom) while (fp < (uchar**) stack_bottom)
{ {
......
...@@ -27,11 +27,9 @@ extern char* heap_start; ...@@ -27,11 +27,9 @@ extern char* heap_start;
#define init_stacktrace() do { \ #define init_stacktrace() do { \
heap_start = (char*) &__bss_start; \ heap_start = (char*) &__bss_start; \
check_thread_lib(); \
} while(0); } while(0);
void print_stacktrace(gptr stack_bottom, ulong thread_stack); void print_stacktrace(gptr stack_bottom, ulong thread_stack);
void safe_print_str(const char* name, const char* val, int max_len); void safe_print_str(const char* name, const char* val, int max_len);
void check_thread_lib(void);
#endif /* (defined (__i386__) || (defined(__alpha__) && defined(__GNUC__))) */ #endif /* (defined (__i386__) || (defined(__alpha__) && defined(__GNUC__))) */
#endif /* TARGET_OS_LINUX */ #endif /* TARGET_OS_LINUX */
......
...@@ -337,11 +337,7 @@ then ...@@ -337,11 +337,7 @@ then
cp -fp mysql-debug-%{mysql_version}/config.log "$MYSQL_DEBUGCONFLOG_DEST" cp -fp mysql-debug-%{mysql_version}/config.log "$MYSQL_DEBUGCONFLOG_DEST"
fi fi
MTR_BUILD_THREAD=auto (cd mysql-debug-%{mysql_version} ; make test-bt-debug)
export MTR_BUILD_THREAD
(cd mysql-debug-%{mysql_version}/mysql-test ; \
./mysql-test-run.pl --comment=debug --skip-rpl --skip-ndbcluster --force --report-features ; \
true)
############################################################################## ##############################################################################
# #
...@@ -370,15 +366,7 @@ then ...@@ -370,15 +366,7 @@ then
cp -fp mysql-release-%{mysql_version}/config.log "$MYSQL_CONFLOG_DEST" cp -fp mysql-release-%{mysql_version}/config.log "$MYSQL_CONFLOG_DEST"
fi fi
MTR_BUILD_THREAD=auto (cd mysql-release-%{mysql_version} ; make test-bt)
export MTR_BUILD_THREAD
cd mysql-release-%{mysql_version}/mysql-test
./mysql-test-run.pl --comment=normal --force --skip-ndbcluster --timer --report-features || true
./mysql-test-run.pl --comment=ps --ps-protocol --force --skip-ndbcluster --timer || true
./mysql-test-run.pl --comment=normal+rowrepl --mysqld=--binlog-format=row --force --skip-ndbcluster --timer || true
./mysql-test-run.pl --comment=ps+rowrepl+NDB --ps-protocol --mysqld=--binlog-format=row --force --timer || true
./mysql-test-run.pl --comment=NDB --with-ndbcluster-only --force --timer || true
cd ../..
############################################################################## ##############################################################################
......
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