Commit 8c6ebbd8 authored by unknown's avatar unknown

Merge chilla.local:/home/mydev/mysql-5.0-axmrg

into  chilla.local:/home/mydev/mysql-5.1-axmrg


client/mysql.cc:
  Auto merged
include/my_global.h:
  Auto merged
include/thr_alarm.h:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/myisam.result:
  Auto merged
mysql-test/r/ps.result:
  Auto merged
mysql-test/r/symlink.result:
  Auto merged
mysql-test/t/myisam.test:
  Auto merged
mysql-test/t/ps.test:
  Auto merged
mysql-test/t/symlink.test:
  Auto merged
mysys/default.c:
  Auto merged
mysys/my_pthread.c:
  Auto merged
mysys/my_thr_init.c:
  Auto merged
mysys/thr_alarm.c:
  Auto merged
sql/field_conv.cc:
  Auto merged
sql/gen_lex_hash.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
vio/viosslfactories.c:
  Auto merged
BitKeeper/deleted/.del-mysqld.cc.rej:
  Delete: sql/mysqld.cc.rej
BitKeeper/deleted/.del-my_create_tables.c~c121a0c4c427ebb:
  Auto merged
BitKeeper/deleted/.del-my_manage.c~4de50e721d227d19:
  Auto merged
BitKeeper/deleted/.del-my_manage.h~9d2cbc1e8bc894f:
  Auto merged
BitKeeper/deleted/.del-mysql.dsw~7ea9e16395f139f4:
  Null merged
BitKeeper/deleted/.del-mysql.sln~76a9ff1e793b3547:
  Null merged
BitKeeper/deleted/.del-mysql_test_run_new.c~a23ab2c4b28b25ad:
  Auto merged
BitKeeper/deleted/.del-mysql_test_run_new.dsp~9d8078f3f02fcc8e:
  Auto merged
BitKeeper/deleted/.del-mysql_test_run_new.vcproj~1ddaed30361efefe:
  Auto merged
BitKeeper/deleted/.del-mysql_test_run_new_ia64.dsp~e7ee71ec8d2995e3:
  Auto merged
BUILD/SETUP.sh:
  Manual merged
Makefile.am:
  Manual merged
configure.in:
  Manual merged
include/my_pthread.h:
  Manual merged
mysql-test/Makefile.am:
  Manual merged
sql/mysqld.cc:
  Manual merged
support-files/mysql.spec.sh:
  Manual merged
parents 0dd09da0 41555dcd
...@@ -139,9 +139,17 @@ fi ...@@ -139,9 +139,17 @@ fi
# #
base_configs="--prefix=$prefix --enable-assembler " base_configs="--prefix=$prefix --enable-assembler "
base_configs="$base_configs --with-extra-charsets=complex " base_configs="$base_configs --with-extra-charsets=complex "
base_configs="$base_configs --enable-thread-safe-client --with-readline " base_configs="$base_configs --enable-thread-safe-client "
base_configs="$base_configs --with-big-tables" base_configs="$base_configs --with-big-tables"
if test -d "$path/../cmd-line-utils/readline"
then
base_configs="$base_configs --with-readline"
elif test -d "$path/../cmd-line-utils/libedit"
then
base_configs="$base_configs --with-libedit"
fi
static_link="--with-mysqld-ldflags=-all-static " static_link="--with-mysqld-ldflags=-all-static "
static_link="$static_link --with-client-ldflags=-all-static" static_link="$static_link --with-client-ldflags=-all-static"
# we need local-infile in all binaries for rpl000001 # we need local-infile in all binaries for rpl000001
......
***************
*** 39,46 ****
c_warnings="$global_warnings -Wunused"
cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor"
! alpha_cflags="-mcpu=ev6 -Wa,-mev6" # Not used yet
! pentium_cflags="-mcpu=pentiumpro"
sparc_cflags=""
# be as fast as we can be without losing our ability to backtrace
--- 39,46 ----
c_warnings="$global_warnings -Wunused"
cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor"
! #alpha_cflags="-mcpu=ev6 -Wa,-mev6" # Not used yet
! #pentium_cflags="-mcpu=pentiumpro"
sparc_cflags=""
# be as fast as we can be without losing our ability to backtrace
...@@ -1408,7 +1408,7 @@ static char **new_mysql_completion (const char *text, int start, int end); ...@@ -1408,7 +1408,7 @@ static char **new_mysql_completion (const char *text, int start, int end);
#if defined(USE_NEW_READLINE_INTERFACE) || defined(USE_LIBEDIT_INTERFACE) #if defined(USE_NEW_READLINE_INTERFACE) || defined(USE_LIBEDIT_INTERFACE)
char *no_completion(const char*,int) char *no_completion(const char*,int)
#else #else
int no_completion() char *no_completion()
#endif #endif
{ {
return 0; /* No filename completion */ return 0; /* No filename completion */
...@@ -1496,10 +1496,10 @@ static void initialize_readline (char *name) ...@@ -1496,10 +1496,10 @@ static void initialize_readline (char *name)
setlocale(LC_ALL,""); /* so as libedit use isprint */ setlocale(LC_ALL,""); /* so as libedit use isprint */
#endif #endif
rl_attempted_completion_function= (CPPFunction*)&new_mysql_completion; rl_attempted_completion_function= (CPPFunction*)&new_mysql_completion;
rl_completion_entry_function= (Function*)&no_completion; rl_completion_entry_function= &no_completion;
#else #else
rl_attempted_completion_function= (CPPFunction*)&new_mysql_completion; rl_attempted_completion_function= (CPPFunction*)&new_mysql_completion;
rl_completion_entry_function= (Function*)&no_completion; rl_completion_entry_function= &no_completion;
#endif #endif
} }
......
...@@ -112,7 +112,7 @@ int rl_attempted_completion_over = 0; ...@@ -112,7 +112,7 @@ int rl_attempted_completion_over = 0;
char *rl_basic_word_break_characters = break_chars; char *rl_basic_word_break_characters = break_chars;
char *rl_completer_word_break_characters = NULL; char *rl_completer_word_break_characters = NULL;
char *rl_completer_quote_characters = NULL; char *rl_completer_quote_characters = NULL;
Function *rl_completion_entry_function = NULL; CPFunction *rl_completion_entry_function = NULL;
CPPFunction *rl_attempted_completion_function = NULL; CPPFunction *rl_attempted_completion_function = NULL;
Function *rl_pre_input_hook = NULL; Function *rl_pre_input_hook = NULL;
Function *rl_startup1_hook = NULL; Function *rl_startup1_hook = NULL;
...@@ -1724,7 +1724,7 @@ rl_display_match_list (matches, len, max) ...@@ -1724,7 +1724,7 @@ rl_display_match_list (matches, len, max)
static int static int
_rl_complete_internal(int what_to_do) _rl_complete_internal(int what_to_do)
{ {
Function *complet_func; CPFunction *complet_func;
const LineInfo *li; const LineInfo *li;
char *temp, **matches; char *temp, **matches;
const char *ctemp; const char *ctemp;
...@@ -1737,7 +1737,7 @@ _rl_complete_internal(int what_to_do) ...@@ -1737,7 +1737,7 @@ _rl_complete_internal(int what_to_do)
complet_func = rl_completion_entry_function; complet_func = rl_completion_entry_function;
if (!complet_func) if (!complet_func)
complet_func = (Function *)(void *)filename_completion_function; complet_func = filename_completion_function;
/* We now look backwards for the start of a filename/variable word */ /* We now look backwards for the start of a filename/variable word */
li = el_line(e); li = el_line(e);
...@@ -1764,7 +1764,7 @@ _rl_complete_internal(int what_to_do) ...@@ -1764,7 +1764,7 @@ _rl_complete_internal(int what_to_do)
} else } else
matches = 0; matches = 0;
if (!rl_attempted_completion_function || !matches) if (!rl_attempted_completion_function || !matches)
matches = completion_matches(temp, (CPFunction *)complet_func); matches = completion_matches(temp, complet_func);
if (matches) { if (matches) {
int i, retval = CC_REFRESH; int i, retval = CC_REFRESH;
...@@ -1789,8 +1789,7 @@ _rl_complete_internal(int what_to_do) ...@@ -1789,8 +1789,7 @@ _rl_complete_internal(int what_to_do)
* object is a directory. * object is a directory.
*/ */
size_t alen = strlen(matches[0]); size_t alen = strlen(matches[0]);
if ((complet_func != if ((complet_func != filename_completion_function
(Function *)filename_completion_function
|| (alen > 0 && (matches[0])[alen - 1] != '/')) || (alen > 0 && (matches[0])[alen - 1] != '/'))
&& rl_completion_append_character) { && rl_completion_append_character) {
char buf[2]; char buf[2];
......
...@@ -102,7 +102,7 @@ extern int max_input_history; ...@@ -102,7 +102,7 @@ extern int max_input_history;
extern char *rl_basic_word_break_characters; extern char *rl_basic_word_break_characters;
extern char *rl_completer_word_break_characters; extern char *rl_completer_word_break_characters;
extern char *rl_completer_quote_characters; extern char *rl_completer_quote_characters;
extern Function *rl_completion_entry_function; extern CPFunction *rl_completion_entry_function;
extern CPPFunction *rl_attempted_completion_function; extern CPPFunction *rl_attempted_completion_function;
extern int rl_completion_type; extern int rl_completion_type;
extern int rl_completion_query_items; extern int rl_completion_query_items;
......
...@@ -2354,6 +2354,7 @@ readline_basedir="" ...@@ -2354,6 +2354,7 @@ readline_basedir=""
readline_dir="" readline_dir=""
readline_h_ln_cmd="" readline_h_ln_cmd=""
readline_link="" readline_link=""
want_to_use_readline="no"
if expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null if expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null
then then
...@@ -2379,6 +2380,7 @@ then ...@@ -2379,6 +2380,7 @@ then
readline_link="\$(top_builddir)/cmd-line-utils/readline/libreadline.a" readline_link="\$(top_builddir)/cmd-line-utils/readline/libreadline.a"
readline_h_ln_cmd="\$(LN) -s \$(top_srcdir)/cmd-line-utils/readline readline" readline_h_ln_cmd="\$(LN) -s \$(top_srcdir)/cmd-line-utils/readline readline"
compile_readline=yes compile_readline=yes
want_to_use_readline="yes"
AC_DEFINE_UNQUOTED(USE_NEW_READLINE_INTERFACE, 1) AC_DEFINE_UNQUOTED(USE_NEW_READLINE_INTERFACE, 1)
else else
# Use system readline library # Use system readline library
...@@ -2388,10 +2390,12 @@ else ...@@ -2388,10 +2390,12 @@ else
MYSQL_CHECK_NEW_RL_INTERFACE MYSQL_CHECK_NEW_RL_INTERFACE
MYSQL_CHECK_READLINE_DECLARES_HIST_ENTRY MYSQL_CHECK_READLINE_DECLARES_HIST_ENTRY
AC_LANG_RESTORE AC_LANG_RESTORE
if [test "$mysql_cv_new_rl_interface" = "yes"] if [test "$mysql_cv_new_rl_interface" = "yes"] && [test -d "./cmd-line-utils/readline"]
then then
# Use the new readline interface # Use the new readline interface, but only if the package includes a bundled libreadline
# this way we avoid linking commercial source with GPL readline
readline_link="-lreadline" readline_link="-lreadline"
want_to_use_readline="yes"
elif [test "$mysql_cv_libedit_interface" = "yes"] elif [test "$mysql_cv_libedit_interface" = "yes"]
then then
# Use libedit # Use libedit
...@@ -2402,6 +2406,15 @@ else ...@@ -2402,6 +2406,15 @@ else
versions of libedit or readline]) versions of libedit or readline])
fi fi
fi fi
# if there is no readline, but we want to build with readline, we fail
if [test "$want_to_use_readline" = "yes"] && [test ! -d "./cmd-line-utils/readline"]
then
AC_MSG_ERROR([This commercially licensed MySQL source package can't
be built with libreadline. Please use --with-libedit to use
the bundled version of libedit instead.])
fi
# #
# if either readline or libedit is enabled - generate Makefile's for both # if either readline or libedit is enabled - generate Makefile's for both
# (to make sure both are included in 'make dist') # (to make sure both are included in 'make dist')
...@@ -2531,7 +2544,8 @@ AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl ...@@ -2531,7 +2544,8 @@ AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
sql/sql_builtin.cc sql-common/Makefile dnl sql/sql_builtin.cc sql-common/Makefile dnl
dbug/Makefile scripts/Makefile include/Makefile dnl dbug/Makefile scripts/Makefile include/Makefile dnl
tests/Makefile Docs/Makefile support-files/Makefile dnl tests/Makefile Docs/Makefile support-files/Makefile dnl
support-files/MacOSX/Makefile mysql-test/Makefile dnl support-files/MacOSX/Makefile support-files/RHEL4-SElinux/Makefile dnl
mysql-test/Makefile dnl
mysql-test/ndb/Makefile netware/Makefile sql-bench/Makefile dnl mysql-test/ndb/Makefile netware/Makefile sql-bench/Makefile dnl
include/mysql_version.h plugin/Makefile win/Makefile) include/mysql_version.h plugin/Makefile win/Makefile)
......
This diff is collapsed.
***************
*** 97,103 ****
/* Fix problem with S_ISLNK() on Linux */
! #if defined(HAVE_LINUXTHREADS)
#undef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
--- 97,103 ----
/* Fix problem with S_ISLNK() on Linux */
! #if defined(TARGET_OS_LINUX) || defined(__GLIBC__)
#undef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
...@@ -690,6 +690,16 @@ extern uint my_thread_end_wait_time; ...@@ -690,6 +690,16 @@ 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;
extern uint thr_client_alarm;
/* statistics_xxx functions are for not essential statistic */ /* statistics_xxx functions are for not essential statistic */
#ifndef thread_safe_increment #ifndef thread_safe_increment
......
***************
*** 286,293 ****
#undef HAVE_PTHREAD_RWLOCK_RDLOCK
#undef HAVE_SNPRINTF
! #define sigset(A,B) pthread_signal((A),(void (*)(int)) (B))
! #define signal(A,B) pthread_signal((A),(void (*)(int)) (B))
#define my_pthread_attr_setprio(A,B)
#endif /* defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM) */
--- 294,301 ----
#undef HAVE_PTHREAD_RWLOCK_RDLOCK
#undef HAVE_SNPRINTF
! #define my_sigset(A,B) pthread_signal((A),(void (*)(int)) (B))
! #define my_signal(A,B) pthread_signal((A),(void (*)(int)) (B))
#define my_pthread_attr_setprio(A,B)
#endif /* defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM) */
***************
*** 324,337 ****
#if !defined(HAVE_SIGWAIT) && !defined(HAVE_mit_thread) && !defined(HAVE_rts_threads) && !defined(sigwait) && !defined(alpha_linux_port) && !defined(HAVE_NONPOSIX_SIGWAIT) && !defined(HAVE_DEC_3_2_THREADS) && !defined(_AIX)
int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */
#endif
! #if !defined(HAVE_SIGSET) && !defined(HAVE_mit_thread) && !defined(sigset)
! #define sigset(A,B) do { struct sigaction s; sigset_t set; \
! sigemptyset(&set); \
! s.sa_handler = (B); \
! s.sa_mask = set; \
! s.sa_flags = 0; \
! sigaction((A), &s, (struct sigaction *) NULL); \
} while (0)
#endif
#ifndef my_pthread_setprio
--- 332,358 ----
#if !defined(HAVE_SIGWAIT) && !defined(HAVE_mit_thread) && !defined(HAVE_rts_threads) && !defined(sigwait) && !defined(alpha_linux_port) && !defined(HAVE_NONPOSIX_SIGWAIT) && !defined(HAVE_DEC_3_2_THREADS) && !defined(_AIX)
int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */
#endif
!
! /*
! We define my_sigset() and use that instead of the system sigset() so that
! we can favor an implementation based on sigaction(). On some systems, such
! as Mac OS X, sigset() results in flags such as SA_RESTART being set, and
! we want to make sure that no such flags are set.
! */
! #if defined(HAVE_SIGACTION) && !defined(my_sigset)
! #define my_sigset(A,B) do { struct sigaction s; sigset_t set; int rc; \
! DBUG_ASSERT((A) != 0); \
! sigemptyset(&set); \
! s.sa_handler = (B); \
! s.sa_mask = set; \
! s.sa_flags = 0; \
! rc= sigaction((A), &s, (struct sigaction *) NULL); \
! DBUG_ASSERT(rc == 0); \
} while (0)
+ #elif defined(HAVE_SIGSET) && !defined(my_sigset)
+ #define my_sigset(A,B) sigset((A),(B))
+ #elif !defined(my_sigset)
+ #define my_sigset(A,B) signal((A),(B))
#endif
#ifndef my_pthread_setprio
***************
*** 416,422 ****
#undef pthread_detach_this_thread
#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(tmp); }
#undef sigset
! #define sigset(A,B) pthread_signal((A),(void (*)(int)) (B))
#endif
#if ((defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT)) || defined(HAVE_DEC_3_2_THREADS)) && !defined(HAVE_CTHREADS_WRAPPER)
--- 437,443 ----
#undef pthread_detach_this_thread
#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(tmp); }
#undef sigset
! #define my_sigset(A,B) pthread_signal((A),(void (*)(int)) (B))
#endif
#if ((defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT)) || defined(HAVE_DEC_3_2_THREADS)) && !defined(HAVE_CTHREADS_WRAPPER)
...@@ -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
...@@ -89,6 +84,8 @@ typedef struct st_alarm { ...@@ -89,6 +84,8 @@ typedef struct st_alarm {
my_bool malloced; my_bool malloced;
} ALARM; } ALARM;
extern uint thr_client_alarm;
#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);
......
...@@ -35,7 +35,6 @@ CLEANFILES = $(GENSCRIPTS) ...@@ -35,7 +35,6 @@ CLEANFILES = $(GENSCRIPTS)
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I.. INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I..
dist-hook: dist-hook:
mkdir -p \ mkdir -p \
$(distdir)/t \ $(distdir)/t \
......
...@@ -29,6 +29,9 @@ ...@@ -29,6 +29,9 @@
#define SCHED_POLICY SCHED_OTHER #define SCHED_POLICY SCHED_OTHER
#endif #endif
uint thd_lib_detected;
uint thr_client_alarm;
#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)
{ {
...@@ -332,7 +335,9 @@ void *sigwait_thread(void *set_arg) ...@@ -332,7 +335,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 @@ pthread_handler_t nptl_pthread_exit_hack_handler(void *arg) ...@@ -63,6 +64,8 @@ pthread_handler_t nptl_pthread_exit_hack_handler(void *arg)
#endif #endif
static uint get_thread_lib(void);
/* /*
initialize thread environment initialize thread environment
...@@ -76,6 +79,12 @@ pthread_handler_t nptl_pthread_exit_hack_handler(void *arg) ...@@ -76,6 +79,12 @@ pthread_handler_t nptl_pthread_exit_hack_handler(void *arg)
my_bool my_thread_global_init(void) my_bool my_thread_global_init(void)
{ {
thd_lib_detected= get_thread_lib();
if (thd_lib_detected == THD_LIB_LT)
thr_client_alarm= SIGALRM;
else
thr_client_alarm= SIGUSR1;
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);
...@@ -392,4 +401,20 @@ const char *my_thread_name(void) ...@@ -392,4 +401,20 @@ const char *my_thread_name(void)
} }
#endif /* DBUG_OFF */ #endif /* DBUG_OFF */
static uint get_thread_lib(void)
{
char buff[64];
#ifdef _CS_GNU_LIBPTHREAD_VERSION
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,16 @@ void init_thr_alarm(uint max_alarms) ...@@ -77,9 +76,16 @@ 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) if (thd_lib_detected == THD_LIB_LT)
my_sigset(THR_CLIENT_ALARM,thread_alarm); thr_client_alarm= SIGALRM;
else
thr_client_alarm= SIGUSR1;
#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 +103,11 @@ void init_thr_alarm(uint max_alarms) ...@@ -97,10 +103,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);
...@@ -271,18 +278,17 @@ sig_handler process_alarm(int sig __attribute__((unused))) ...@@ -271,18 +278,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,
...@@ -326,7 +332,7 @@ static sig_handler process_alarm_part2(int sig __attribute__((unused))) ...@@ -326,7 +332,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");
...@@ -350,7 +356,7 @@ static sig_handler process_alarm_part2(int sig __attribute__((unused))) ...@@ -350,7 +356,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");
...@@ -487,7 +493,7 @@ void thr_alarm_info(ALARM_INFO *info) ...@@ -487,7 +493,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
...@@ -497,7 +503,6 @@ static sig_handler thread_alarm(int sig) ...@@ -497,7 +503,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
...@@ -783,9 +788,7 @@ static void *signal_hand(void *arg __attribute__((unused))) ...@@ -783,9 +788,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
...@@ -796,7 +799,7 @@ static void *signal_hand(void *arg __attribute__((unused))) ...@@ -796,7 +799,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(;;)
{ {
...@@ -864,11 +867,11 @@ int main(int argc __attribute__((unused)),char **argv __attribute__((unused))) ...@@ -864,11 +867,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
......
***************
*** 76,96 ****
alarm_aborted=0;
init_queue(&alarm_queue,max_alarms+1,offsetof(ALARM,expire_time),0,
compare_ulong,NullS);
! sigfillset(&full_signal_set); /* Neaded to block signals */
pthread_mutex_init(&LOCK_alarm,MY_MUTEX_INIT_FAST);
pthread_cond_init(&COND_alarm,NULL);
! #if THR_CLIENT_ALARM != SIGALRM || defined(USE_ALARM_THREAD)
! #if defined(HAVE_mit_thread)
! sigset(THR_CLIENT_ALARM,thread_alarm); /* int. thread system calls */
! #else
{
! struct sigaction sact;
! sact.sa_flags = 0;
! sact.sa_handler = thread_alarm;
! sigaction(THR_CLIENT_ALARM, &sact, (struct sigaction*) 0);
}
- #endif
- #endif
sigemptyset(&s);
sigaddset(&s, THR_SERVER_ALARM);
alarm_thread=pthread_self();
--- 74,89 ----
alarm_aborted=0;
init_queue(&alarm_queue,max_alarms+1,offsetof(ALARM,expire_time),0,
compare_ulong,NullS);
! sigfillset(&full_signal_set); /* Needed to block signals */
pthread_mutex_init(&LOCK_alarm,MY_MUTEX_INIT_FAST);
pthread_cond_init(&COND_alarm,NULL);
! #ifndef USE_ALARM_THREAD
! if (thd_lib_detected != THD_LIB_LT)
! #endif
{
! my_sigset(thd_lib_detected == THD_LIB_LT ? SIGALRM : SIGUSR1,
! thread_alarm);
}
sigemptyset(&s);
sigaddset(&s, THR_SERVER_ALARM);
alarm_thread=pthread_self();
***************
*** 108,120 ****
}
#elif defined(USE_ONE_SIGNAL_HAND)
pthread_sigmask(SIG_BLOCK, &s, NULL); /* used with sigwait() */
! #if THR_SERVER_ALARM == THR_CLIENT_ALARM
! sigset(THR_CLIENT_ALARM,process_alarm); /* Linuxthreads */
! pthread_sigmask(SIG_UNBLOCK, &s, NULL);
! #endif
#else
pthread_sigmask(SIG_UNBLOCK, &s, NULL);
- sigset(THR_SERVER_ALARM,process_alarm);
#endif
DBUG_VOID_RETURN;
}
--- 101,115 ----
}
#elif defined(USE_ONE_SIGNAL_HAND)
pthread_sigmask(SIG_BLOCK, &s, NULL); /* used with sigwait() */
! if (thd_lib_detected == THD_LIB_LT)
! {
! my_sigset(thd_lib_detected == THD_LIB_LT ? SIGALRM : SIGUSR1,
! process_alarm); /* Linuxthreads */
! pthread_sigmask(SIG_UNBLOCK, &s, NULL);
! }
#else
+ my_sigset(THR_SERVER_ALARM, process_alarm);
pthread_sigmask(SIG_UNBLOCK, &s, NULL);
#endif
DBUG_VOID_RETURN;
}
***************
*** 240,246 ****
if (alarm_data->malloced)
my_free((gptr) alarm_data,MYF(0));
found++;
! #ifndef DBUG_OFF
break;
#endif
}
--- 235,241 ----
if (alarm_data->malloced)
my_free((gptr) alarm_data,MYF(0));
found++;
! #ifdef DBUG_OFF
break;
#endif
}
***************
*** 249,258 ****
if (!found)
{
if (*alarmed)
! fprintf(stderr,"Warning: Didn't find alarm %lx in queue of %d alarms\n",
! (long) *alarmed, alarm_queue.elements);
! DBUG_PRINT("warning",("Didn't find alarm %lx in queue\n",
! (long) *alarmed));
}
pthread_mutex_unlock(&LOCK_alarm);
pthread_sigmask(SIG_SETMASK,&old_mask,NULL);
--- 244,254 ----
if (!found)
{
if (*alarmed)
! fprintf(stderr,
! "Warning: Didn't find alarm 0x%lx in queue of %d alarms\n",
! (long) *alarmed, alarm_queue.elements);
! DBUG_PRINT("warning",("Didn't find alarm 0x%lx in queue\n",
! (long) *alarmed));
}
pthread_mutex_unlock(&LOCK_alarm);
pthread_sigmask(SIG_SETMASK,&old_mask,NULL);
***************
*** 274,291 ****
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 (!pthread_equal(pthread_self(),alarm_thread))
{
#if defined(MAIN) && !defined(__bsdi__)
! printf("thread_alarm\n"); fflush(stdout);
#endif
#ifdef DONT_REMEMBER_SIGNAL
! sigset(THR_CLIENT_ALARM,process_alarm); /* int. thread system calls */
#endif
return;
}
- #endif
/*
We have to do do the handling of the alarm in a sub function,
--- 270,287 ----
This must be first as we can't call DBUG inside an alarm for a normal thread
*/
! if (thd_lib_detected == THD_LIB_LT &&
! !pthread_equal(pthread_self(),alarm_thread))
{
#if defined(MAIN) && !defined(__bsdi__)
! printf("thread_alarm in process_alarm\n"); fflush(stdout);
#endif
#ifdef DONT_REMEMBER_SIGNAL
! my_sigset(thd_lib_detected == THD_LIB_LT ? SIGALRM : SIGUSR1,
! process_alarm); /* int. thread system calls */
#endif
return;
}
/*
We have to do do the handling of the alarm in a sub function,
***************
*** 301,307 ****
process_alarm_part2(sig);
#ifndef USE_ALARM_THREAD
#if defined(DONT_REMEMBER_SIGNAL) && !defined(USE_ONE_SIGNAL_HAND)
! sigset(THR_SERVER_ALARM,process_alarm);
#endif
pthread_mutex_unlock(&LOCK_alarm);
pthread_sigmask(SIG_SETMASK,&old_mask,NULL);
--- 297,303 ----
process_alarm_part2(sig);
#ifndef USE_ALARM_THREAD
#if defined(DONT_REMEMBER_SIGNAL) && !defined(USE_ONE_SIGNAL_HAND)
! my_sigset(THR_SERVER_ALARM, process_alarm);
#endif
pthread_mutex_unlock(&LOCK_alarm);
pthread_sigmask(SIG_SETMASK,&old_mask,NULL);
***************
*** 504,520 ****
ARGSUSED
*/
- #if THR_CLIENT_ALARM != SIGALRM || defined(USE_ALARM_THREAD)
static sig_handler thread_alarm(int sig)
{
#ifdef MAIN
printf("thread_alarm\n"); fflush(stdout);
#endif
#ifdef DONT_REMEMBER_SIGNAL
! sigset(sig,thread_alarm); /* int. thread system calls */
#endif
}
- #endif
#ifdef HAVE_TIMESPEC_TS_SEC
--- 499,513 ----
ARGSUSED
*/
static sig_handler thread_alarm(int sig)
{
#ifdef MAIN
printf("thread_alarm\n"); fflush(stdout);
#endif
#ifdef DONT_REMEMBER_SIGNAL
! my_sigset(sig, thread_alarm); /* int. thread system calls */
#endif
}
#ifdef HAVE_TIMESPEC_TS_SEC
***************
*** 915,921 ****
printf("Warning: Got signal %d from thread %s\n",sig,my_thread_name());
fflush(stdout);
#ifdef DONT_REMEMBER_SIGNAL
! sigset(sig,print_signal_warning); /* int. thread system calls */
#endif
#ifndef OS2
if (sig == SIGALRM)
--- 908,914 ----
printf("Warning: Got signal %d from thread %s\n",sig,my_thread_name());
fflush(stdout);
#ifdef DONT_REMEMBER_SIGNAL
! my_sigset(sig, print_signal_warning); /* int. thread system calls */
#endif
#ifndef OS2
if (sig == SIGALRM)
#!/bin/sh #!/bin/sh
# Copyright (C) 1979-1996 TcX AB & Monty Program KB & Detron HB # Copyright (C) 1979-2007 MySQL AB
# #
# This software is distributed with NO WARRANTY OF ANY KIND. No author or # This program is free software; you can redistribute it and/or modify
# distributor accepts any responsibility for the consequences of using it, or # it under the terms of the GNU General Public License as published by
# for whether it serves any particular purpose or works at all, unless he or # the Free Software Foundation; version 2 of the License.
# she says so in writing. Refer to the Free Public License (the "License")
# for full details.
# #
# Every copy of this file must include a copy of the License, normally in a # This program is distributed in the hope that it will be useful,
# plain ASCII text file named PUBLIC. The License grants you the right to # but WITHOUT ANY WARRANTY; without even the implied warranty of
# copy, modify and redistribute this file, but only under certain conditions # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# described in the License. Among other things, the License requires that # GNU General Public License for more details.
# the copyright notice and this notice be preserved on all copies. #
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING. If not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston
# MA 02110-1301 USA.
@bindir@/replace msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* @bindir@/replace msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $*
...@@ -445,10 +445,24 @@ int main(int argc,char **argv) ...@@ -445,10 +445,24 @@ int main(int argc,char **argv)
/* Broken up to indicate that it's not advice to you, gentle reader. */ /* Broken up to indicate that it's not advice to you, gentle reader. */
printf("/*\n\n Do " "not " "edit " "this " "file " "directly!\n\n*/\n"); printf("/*\n\n Do " "not " "edit " "this " "file " "directly!\n\n*/\n");
printf("/* Copyright (C) 2001-2004 MySQL AB\n\ printf("\
This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n\ /* Copyright (C) 2001-2004 MySQL AB\n\
and you are welcome to modify and redistribute it under the GPL license\n\ \n\
\n*/\n\n"); This program is free software; you can redistribute it and/or modify\n\
it under the terms of the GNU General Public License as published by\n\
the Free Software Foundation; version 2 of the License.\n\
\n\
This program is distributed in the hope that it will be useful,\n\
but WITHOUT ANY WARRANTY; without even the implied warranty of\n\
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\
GNU General Public License for more details.\n\
\n\
You should have received a copy of the GNU General Public License\n\
along with this program; see the file COPYING. If not, write to the\n\
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston\n\
MA 02110-1301 USA. */\n\
\n\
");
/* Broken up to indicate that it's not advice to you, gentle reader. */ /* Broken up to indicate that it's not advice to you, gentle reader. */
printf("/* Do " "not " "edit " "this " "file! This is generated by " printf("/* Do " "not " "edit " "this " "file! This is generated by "
......
...@@ -199,12 +199,6 @@ inline void reset_floating_point_exceptions() ...@@ -199,12 +199,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
...@@ -595,6 +589,7 @@ pthread_mutex_t LOCK_server_started; ...@@ -595,6 +589,7 @@ pthread_mutex_t LOCK_server_started;
pthread_cond_t COND_server_started; pthread_cond_t COND_server_started;
int mysqld_server_started= 0; int mysqld_server_started= 0;
static uint thr_kill_signal;
File_parser_dummy_hook file_parser_dummy_hook; File_parser_dummy_hook file_parser_dummy_hook;
...@@ -768,7 +763,7 @@ static void close_connections(void) ...@@ -768,7 +763,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);
...@@ -2188,7 +2183,9 @@ static void init_signals(void) ...@@ -2188,7 +2183,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))
...@@ -2245,8 +2242,12 @@ static void init_signals(void) ...@@ -2245,8 +2242,12 @@ static void init_signals(void)
#endif #endif
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);
}
// For alarms
sigdelset(&set, thr_client_alarm);
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;
...@@ -2310,23 +2311,19 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused))) ...@@ -2310,23 +2311,19 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused)))
*/ */
init_thr_alarm(max_connections + init_thr_alarm(max_connections +
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);
...@@ -3481,6 +3478,9 @@ int main(int argc, char **argv) ...@@ -3481,6 +3478,9 @@ int main(int argc, char **argv)
exit(1); exit(1);
} }
/* Set signal used to kill MySQL */
thr_kill_signal= thd_lib_detected == THD_LIB_LT ? SIGINT : SIGUSR2;
/* /*
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.
......
...@@ -30,7 +30,7 @@ EXTRA_DIST = mysql.spec.sh \ ...@@ -30,7 +30,7 @@ EXTRA_DIST = mysql.spec.sh \
MySQL-shared-compat.spec.sh \ MySQL-shared-compat.spec.sh \
ndb-config-2-node.ini.sh ndb-config-2-node.ini.sh
SUBDIRS = MacOSX SUBDIRS = MacOSX RHEL4-SElinux
pkgdata_DATA = my-small.cnf \ pkgdata_DATA = my-small.cnf \
my-medium.cnf \ my-medium.cnf \
......
# Copyright (C) 2000-2001, 2003-2006 MySQL AB
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; version 2
# of the License.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA
## Process this file with automake to create Makefile.in
EXTRA_DIST = mysql.fc mysql.te
# Don't update the files from bitkeeper
%::SCCS/s.%
# MySQL Database Server
#
# /etc
#
/etc/my\.cnf -- gen_context(system_u:object_r:mysqld_etc_t,s0)
/etc/mysql(/.*)? gen_context(system_u:object_r:mysqld_etc_t,s0)
#
# /usr
# Red Hat compatibility
/usr/libexec/mysqld -- gen_context(system_u:object_r:mysqld_exec_t,s0)
# MySQL AB compatibility
/usr/sbin/mysqld(-max)? -- gen_context(system_u:object_r:mysqld_exec_t,s0)
#
# /var
#
/var/lib/mysql(/.*)? gen_context(system_u:object_r:mysqld_db_t,s0)
/var/lib/mysql/mysql\.sock -s gen_context(system_u:object_r:mysqld_var_run_t,s0)
/var/log/mysql.* -- gen_context(system_u:object_r:mysqld_log_t,s0)
/var/run/mysqld(/.*)? gen_context(system_u:object_r:mysqld_var_run_t,s0)
policy_module(mysql,1.0.0)
########################################
#
# Declarations
#
type mysqld_t;
type mysqld_exec_t;
init_daemon_domain(mysqld_t,mysqld_exec_t)
type mysqld_var_run_t;
files_pid_file(mysqld_var_run_t)
type mysqld_db_t;
files_type(mysqld_db_t)
type mysqld_etc_t alias etc_mysqld_t;
files_config_file(mysqld_etc_t)
type mysqld_log_t;
logging_log_file(mysqld_log_t)
type mysqld_tmp_t;
files_tmp_file(mysqld_tmp_t)
########################################
#
# Local policy
#
allow mysqld_t self:capability { dac_override setgid setuid sys_resource net_bind_service };
dontaudit mysqld_t self:capability sys_tty_config;
allow mysqld_t self:process { setsched getsched setrlimit signal_perms rlimitinh };
allow mysqld_t self:fifo_file { read write };
allow mysqld_t self:unix_stream_socket create_stream_socket_perms;
allow mysqld_t self:tcp_socket create_stream_socket_perms;
allow mysqld_t self:udp_socket create_socket_perms;
allow mysqld_t mysqld_db_t:dir create_dir_perms;
allow mysqld_t mysqld_db_t:file create_file_perms;
allow mysqld_t mysqld_db_t:lnk_file create_lnk_perms;
files_var_lib_filetrans(mysqld_t,mysqld_db_t,{ dir file })
allow mysqld_t mysqld_etc_t:file { getattr read };
allow mysqld_t mysqld_etc_t:lnk_file { getattr read };
allow mysqld_t mysqld_etc_t:dir list_dir_perms;
allow mysqld_t mysqld_log_t:file create_file_perms;
logging_log_filetrans(mysqld_t,mysqld_log_t,file)
allow mysqld_t mysqld_tmp_t:dir create_dir_perms;
allow mysqld_t mysqld_tmp_t:file create_file_perms;
files_tmp_filetrans(mysqld_t, mysqld_tmp_t, { file dir })
allow mysqld_t mysqld_var_run_t:dir rw_dir_perms;
allow mysqld_t mysqld_var_run_t:sock_file create_file_perms;
allow mysqld_t mysqld_var_run_t:file create_file_perms;
files_pid_filetrans(mysqld_t,mysqld_var_run_t,file)
kernel_read_system_state(mysqld_t)
kernel_read_kernel_sysctls(mysqld_t)
corenet_non_ipsec_sendrecv(mysqld_t)
corenet_tcp_sendrecv_all_if(mysqld_t)
corenet_udp_sendrecv_all_if(mysqld_t)
corenet_tcp_sendrecv_all_nodes(mysqld_t)
corenet_udp_sendrecv_all_nodes(mysqld_t)
corenet_tcp_sendrecv_all_ports(mysqld_t)
corenet_udp_sendrecv_all_ports(mysqld_t)
corenet_tcp_bind_all_nodes(mysqld_t)
corenet_tcp_bind_mysqld_port(mysqld_t)
corenet_tcp_connect_mysqld_port(mysqld_t)
corenet_sendrecv_mysqld_client_packets(mysqld_t)
corenet_sendrecv_mysqld_server_packets(mysqld_t)
dev_read_sysfs(mysqld_t)
fs_getattr_all_fs(mysqld_t)
fs_search_auto_mountpoints(mysqld_t)
term_dontaudit_use_console(mysqld_t)
domain_use_interactive_fds(mysqld_t)
files_getattr_var_lib_dirs(mysqld_t)
files_read_etc_runtime_files(mysqld_t)
files_read_etc_files(mysqld_t)
files_read_usr_files(mysqld_t)
files_search_var_lib(mysqld_t)
auth_use_nsswitch(mysqld_t)
init_use_fds(mysqld_t)
init_use_script_ptys(mysqld_t)
libs_use_ld_so(mysqld_t)
libs_use_shared_libs(mysqld_t)
logging_send_syslog_msg(mysqld_t)
miscfiles_read_localization(mysqld_t)
sysnet_read_config(mysqld_t)
userdom_dontaudit_use_unpriv_user_fds(mysqld_t)
# for /root/.my.cnf - should not be needed:
userdom_read_sysadm_home_content_files(mysqld_t)
ifdef(`distro_redhat',`
# because Fedora has the sock_file in the database directory
type_transition mysqld_t mysqld_db_t:sock_file mysqld_var_run_t;
')
ifdef(`targeted_policy',`
term_dontaudit_use_unallocated_ttys(mysqld_t)
term_dontaudit_use_generic_ptys(mysqld_t)
files_dontaudit_read_root_files(mysqld_t)
')
optional_policy(`
daemontools_service_domain(mysqld_t, mysqld_exec_t)
')
optional_policy(`
seutil_sigchld_newrole(mysqld_t)
')
optional_policy(`
udev_read_db(mysqld_t)
')
# Copyright (C) 2000-2007 MySQL AB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING. If not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston
# MA 02110-1301 USA.
%define mysql_version @VERSION@ %define mysql_version @VERSION@
...@@ -71,12 +86,9 @@ is intended for mission-critical, heavy-load production systems as well ...@@ -71,12 +86,9 @@ is intended for mission-critical, heavy-load production systems as well
as for embedding into mass-deployed software. MySQL is a trademark of as for embedding into mass-deployed software. MySQL is a trademark of
MySQL AB. MySQL AB.
The MySQL software has Dual Licensing, which means you can use the MySQL Copyright (C) 2000-2007 MySQL AB
software free of charge under the GNU General Public License This software comes with ABSOLUTELY NO WARRANTY. This is free software,
(http://www.gnu.org/licenses/). You can also purchase commercial MySQL and you are welcome to modify and redistribute it under the GPL license.
licenses from MySQL AB if you do not wish to be bound by the terms of
the GPL. See the chapter "Licensing and Support" in the manual for
further info.
The MySQL web site (http://www.mysql.com/) provides the latest The MySQL web site (http://www.mysql.com/) provides the latest
news and information about the MySQL software. Also please see the news and information about the MySQL software. Also please see the
...@@ -96,12 +108,9 @@ is intended for mission-critical, heavy-load production systems as well ...@@ -96,12 +108,9 @@ is intended for mission-critical, heavy-load production systems as well
as for embedding into mass-deployed software. MySQL is a trademark of as for embedding into mass-deployed software. MySQL is a trademark of
MySQL AB. MySQL AB.
The MySQL software has Dual Licensing, which means you can use the MySQL Copyright (C) 2000-2007 MySQL AB
software free of charge under the GNU General Public License This software comes with ABSOLUTELY NO WARRANTY. This is free software,
(http://www.gnu.org/licenses/). You can also purchase commercial MySQL and you are welcome to modify and redistribute it under the GPL license.
licenses from MySQL AB if you do not wish to be bound by the terms of
the GPL. See the chapter "Licensing and Support" in the manual for
further info.
The MySQL web site (http://www.mysql.com/) provides the latest The MySQL web site (http://www.mysql.com/) provides the latest
news and information about the MySQL software. Also please see the news and information about the MySQL software. Also please see the
...@@ -329,6 +338,7 @@ then ...@@ -329,6 +338,7 @@ then
fi fi
(cd mysql-debug-%{mysql_version}/mysql-test ; \ (cd mysql-debug-%{mysql_version}/mysql-test ; \
MTR_BUILD_THREAD=auto ; export MTR_BUILD_THREAD ; \
./mysql-test-run.pl --comment=debug --skip-rpl --skip-ndbcluster --force --report-features ; \ ./mysql-test-run.pl --comment=debug --skip-rpl --skip-ndbcluster --force --report-features ; \
true) true)
...@@ -360,6 +370,8 @@ then ...@@ -360,6 +370,8 @@ then
fi fi
cd mysql-release-%{mysql_version}/mysql-test cd mysql-release-%{mysql_version}/mysql-test
MTR_BUILD_THREAD=auto
export MTR_BUILD_THREAD
./mysql-test-run.pl --comment=normal --force --skip-ndbcluster --timer --report-features || true ./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=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=normal+rowrepl --mysqld=--binlog-format=row --force --skip-ndbcluster --timer || true
...@@ -705,6 +717,10 @@ fi ...@@ -705,6 +717,10 @@ fi
# itself - note that they must be ordered by date (important when # itself - note that they must be ordered by date (important when
# merging BK trees) # merging BK trees)
%changelog %changelog
* Wed Jan 31 2007 Daniel Fischer <df@mysql.com>
- add MTR_BUILD_THREAD=auto to test runs.
* Fri Jan 05 2007 Kent Boortz <kent@mysql.com> * Fri Jan 05 2007 Kent Boortz <kent@mysql.com>
- Put back "libmygcc.a", found no real reason it was removed. - Put back "libmygcc.a", found no real reason it was removed.
......
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