List:Commits« Previous MessageNext Message »
From:jani Date:January 30 2007 9:09pm
Subject:bk commit into 5.0 tree (jani:1.2390)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of jani. When jani does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-01-30 22:08:52+02:00, jani@stripped +14 -0
  Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-4.1
  into  ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0-main
  MERGE: 1.1616.2917.15

  BUILD/SETUP.sh@stripped, 2007-01-30 21:51:24+02:00, jani@stripped +0 -0
    Auto merged
    MERGE: 1.26.1.14

  BitKeeper/etc/gone@stripped, 2007-01-30 21:51:20+02:00, jani@stripped +1
-1
    auto-union
    MERGE: 1.92.1.4

  configure.in@stripped, 2007-01-30 21:51:24+02:00, jani@stripped +0 -1
    Auto merged
    MERGE: 1.201.64.20

  include/my_global.h@stripped, 2007-01-30 21:51:24+02:00, jani@stripped
+0 -1
    Auto merged
    MERGE: 1.47.1.66

  include/my_pthread.h@stripped, 2007-01-30 22:08:50+02:00, jani@stripped
+1 -0
    Manual merge from 4.1.
    MERGE: 1.65.1.19

  include/thr_alarm.h@stripped, 2007-01-30 21:51:24+02:00, jani@stripped +0
-0
    Auto merged
    MERGE: 1.17.1.1

  mysql-test/mysql-test-run.pl@stripped, 2007-01-30 21:51:24+02:00,
jani@stripped +0 -0
    Auto merged
    MERGE: 1.8.20.2

  mysys/default.c@stripped, 2007-01-30 22:08:50+02:00, jani@stripped +0 -2
    Manual merge from 4.1.
    MERGE: 1.43.1.9

  mysys/my_pthread.c@stripped, 2007-01-30 21:51:25+02:00, jani@stripped +0
-0
    Auto merged
    MERGE: 1.37.1.8

  mysys/my_thr_init.c@stripped, 2007-01-30 22:08:50+02:00, jani@stripped +0
-0
    Manual merge from 4.1.
    MERGE: 1.30.1.1

  mysys/thr_alarm.c@stripped, 2007-01-30 22:08:50+02:00, jani@stripped +3
-9
    Manual merge from 4.1.
    MERGE: 1.44.2.4

  sql/ha_ndbcluster.cc@stripped, 2007-01-30 22:08:50+02:00, jani@stripped
+0 -1
    Manual merge from 4.1.
    MERGE: 1.114.3.79

  sql/item_func.cc@stripped, 2007-01-30 21:51:25+02:00, jani@stripped +0
-0
    Auto merged
    MERGE: 1.124.42.19

  sql/mysqld.cc@stripped, 2007-01-30 22:08:50+02:00, jani@stripped +1 -2
    Manual merge from 4.1.
    MERGE: 1.356.98.36

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	jani
# Host:	ua141d10.elisa.omakaista.fi
# Root:	/home/my/bk/mysql-5.0-main/RESYNC

--- 1.95/include/my_pthread.h	2007-01-30 22:09:00 +02:00
+++ 1.96/include/my_pthread.h	2007-01-30 22:09:00 +02:00
@@ -764,6 +764,16 @@
   Keep track of shutdown,signal, and main threads so that my_end() will not
   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 */
 
 #ifndef thread_safe_increment

--- 1.18/include/thr_alarm.h	2007-01-30 22:09:00 +02:00
+++ 1.19/include/thr_alarm.h	2007-01-30 22:09:00 +02:00
@@ -24,11 +24,6 @@
 #ifndef USE_ALARM_THREAD
 #define USE_ONE_SIGNAL_HAND		/* One must call process_alarm */
 #endif
-#ifdef HAVE_LINUXTHREADS
-#define THR_CLIENT_ALARM SIGALRM
-#else
-#define THR_CLIENT_ALARM SIGUSR1
-#endif
 #ifdef HAVE_rts_threads
 #undef USE_ONE_SIGNAL_HAND
 #define USE_ALARM_THREAD

--- 1.44/mysys/my_pthread.c	2007-01-30 22:09:00 +02:00
+++ 1.45/mysys/my_pthread.c	2007-01-30 22:09:00 +02:00
@@ -29,6 +29,9 @@
 #define SCHED_POLICY SCHED_OTHER
 #endif
 
+uint thd_lib_detected;
+uint thr_client_alarm;
+
 #ifndef my_pthread_setprio
 void my_pthread_setprio(pthread_t thread_id,int prior)
 {
@@ -335,7 +338,9 @@
       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);
   alarm_thread=pthread_self();			/* For thr_alarm */
 

--- 1.36/mysys/my_thr_init.c	2007-01-30 22:09:00 +02:00
+++ 1.37/mysys/my_thr_init.c	2007-01-30 22:09:00 +02:00
@@ -20,6 +20,7 @@
 
 #include "mysys_priv.h"
 #include <m_string.h>
+#include <signal.h>
 
 #ifdef THREAD
 #ifdef USE_TLS
@@ -46,6 +47,8 @@
 pthread_mutexattr_t my_errorcheck_mutexattr;
 #endif
 
+static uint get_thread_lib(void);
+
 #ifdef NPTL_PTHREAD_EXIT_BUG /* see my_pthread.h */
 
 /*
@@ -76,6 +79,12 @@
 
 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))
   {
     fprintf(stderr,"Can't initialize threads: error %d\n",errno);
@@ -391,5 +400,21 @@
   return tmp->name;
 }
 #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 */

--- 1.50/mysys/thr_alarm.c	2007-01-30 22:09:00 +02:00
+++ 1.51/mysys/thr_alarm.c	2007-01-30 22:09:00 +02:00
@@ -57,9 +57,7 @@
 #define reschedule_alarms() pthread_kill(alarm_thread,THR_SERVER_ALARM)
 #endif
 
-#if THR_CLIENT_ALARM != SIGALRM || defined(USE_ALARM_THREAD)
 static sig_handler thread_alarm(int sig __attribute__((unused)));
-#endif
 
 static int compare_ulong(void *not_used __attribute__((unused)),
 			 byte *a_ptr,byte* b_ptr)
@@ -78,9 +76,12 @@
   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)
-  my_sigset(THR_CLIENT_ALARM,thread_alarm);
+#ifndef USE_ALARM_THREAD
+  if (thd_lib_detected != THD_LIB_LT)
 #endif
+  {
+    my_sigset(thr_client_alarm, thread_alarm);
+  }
   sigemptyset(&s);
   sigaddset(&s, THR_SERVER_ALARM);
   alarm_thread=pthread_self();
@@ -98,10 +99,11 @@
   }
 #elif defined(USE_ONE_SIGNAL_HAND)
   pthread_sigmask(SIG_BLOCK, &s, NULL);		/* used with sigwait() */
-#if THR_SERVER_ALARM == THR_CLIENT_ALARM
-  my_sigset(THR_CLIENT_ALARM,process_alarm);	/* Linuxthreads */
-  pthread_sigmask(SIG_UNBLOCK, &s, NULL);
-#endif
+  if (thd_lib_detected == THD_LIB_LT)
+  {
+    my_sigset(thr_client_alarm, process_alarm);        /* Linuxthreads */
+    pthread_sigmask(SIG_UNBLOCK, &s, NULL);
+  }
 #else
   my_sigset(THR_SERVER_ALARM, process_alarm);
   pthread_sigmask(SIG_UNBLOCK, &s, NULL);
@@ -152,7 +154,7 @@
 
   now=(ulong) time((time_t*) 0);
   pthread_sigmask(SIG_BLOCK,&full_signal_set,&old_mask);
-  pthread_mutex_lock(&LOCK_alarm);	/* Lock from threads & alarms */
+  pthread_mutex_lock(&LOCK_alarm);        /* Lock from threads & alarms */
   if (alarm_aborted > 0)
   {					/* No signal thread */
     DBUG_PRINT("info", ("alarm aborted"));
@@ -272,18 +274,17 @@
   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 (thd_lib_detected == THD_LIB_LT &&
+      !pthread_equal(pthread_self(),alarm_thread))
   {
 #if defined(MAIN) && !defined(__bsdi__)
-    printf("thread_alarm\n"); fflush(stdout);
+    printf("thread_alarm in process_alarm\n"); fflush(stdout);
 #endif
 #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
     return;
   }
-#endif
 
   /*
     We have to do do the handling of the alarm in a sub function,
@@ -327,7 +328,7 @@
 	alarm_data=(ALARM*) queue_element(&alarm_queue,i);
 	alarm_data->alarmed=1;			/* Info to 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
 	  printf("Warning: pthread_kill couldn't find thread!!!\n");
@@ -351,7 +352,7 @@
 	alarm_data->alarmed=1;			/* Info to thread */
 	DBUG_PRINT("info",("sending signal to waiting 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
 	  printf("Warning: pthread_kill couldn't find thread!!!\n");
@@ -421,9 +422,9 @@
       set_timespec(abstime, 10);		/* Wait up to 10 seconds */
       while (alarm_thread_running)
       {
-	int error= pthread_cond_timedwait(&COND_alarm, &LOCK_alarm, &abstime);
-	if (error == ETIME || error == ETIMEDOUT)
-	  break;				/* Don't wait forever */
+        int error= pthread_cond_timedwait(&COND_alarm, &LOCK_alarm,
&abstime);
+        if (error == ETIME || error == ETIMEDOUT)
+          break;				/* Don't wait forever */
       }
       delete_queue(&alarm_queue);
       alarm_aborted= 1;
@@ -488,7 +489,7 @@
   ARGSUSED
 */
 
-#if THR_CLIENT_ALARM != SIGALRM || defined(USE_ALARM_THREAD)
+
 static sig_handler thread_alarm(int sig)
 {
 #ifdef MAIN
@@ -498,7 +499,6 @@
   my_sigset(sig,thread_alarm);		/* int. thread system calls */
 #endif
 }
-#endif
 
 
 #ifdef HAVE_TIMESPEC_TS_SEC
@@ -926,9 +926,7 @@
   sigaddset(&set,SIGINT);
   sigaddset(&set,SIGQUIT);
   sigaddset(&set,SIGTERM);
-#if THR_CLIENT_ALARM != SIGHUP
   sigaddset(&set,SIGHUP);
-#endif
 #ifdef SIGTSTP
   sigaddset(&set,SIGTSTP);
 #endif
@@ -940,7 +938,7 @@
 #endif
 #endif /* OS2 */
   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"));
   for(;;)
   {
@@ -1012,11 +1010,11 @@
   sigaddset(&set,SIGTSTP);
 #endif
   sigaddset(&set,THR_SERVER_ALARM);
-  sigdelset(&set,THR_CLIENT_ALARM);
+  sigdelset(&set, thr_client_alarm);
   (void) pthread_sigmask(SIG_SETMASK,&set,NULL);
 #ifdef NOT_USED
   sigemptyset(&set);
-  sigaddset(&set,THR_CLIENT_ALARM);
+  sigaddset(&set, thr_client_alarm);
   VOID(pthread_sigmask(SIG_UNBLOCK, &set, (sigset_t*) 0));
 #endif
 #endif /* OS2 */
@@ -1066,8 +1064,8 @@
     }
   }
   pthread_mutex_unlock(&LOCK_thread_count);
-  end_thr_alarm(1);
   thr_alarm_info(&alarm_info);
+  end_thr_alarm(1);
   printf("Main_thread:  Alarms: %u  max_alarms: %u  next_alarm_time: %lu\n",
 	 alarm_info.active_alarms, alarm_info.max_used_alarms,
 	 alarm_info.next_alarm_time);

--- 1.591/sql/mysqld.cc	2007-01-30 22:09:00 +02:00
+++ 1.592/sql/mysqld.cc	2007-01-30 22:09:00 +02:00
@@ -198,12 +198,6 @@
 
 } /* 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
 
 #ifdef HAVE_GLIBC2_STYLE_GETHOSTBYNAME_R
@@ -523,6 +517,7 @@
 pthread_cond_t COND_refresh,COND_thread_count, COND_global_read_lock;
 pthread_t signal_thread;
 pthread_attr_t connection_attrib;
+static uint thr_kill_signal;
 
 File_parser_dummy_hook file_parser_dummy_hook;
 
@@ -698,7 +693,7 @@
     DBUG_PRINT("info",("Waiting for select thread"));
 
 #ifndef DONT_USE_THR_ALARM
-    if (pthread_kill(select_thread,THR_CLIENT_ALARM))
+    if (pthread_kill(select_thread, thr_client_alarm))
       break;					// allready dead
 #endif
     set_timespec(abstime, 2);
@@ -2154,7 +2149,9 @@
   DBUG_ENTER("init_signals");
 
   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!
 
   if (!(test_flags & TEST_NO_STACKTRACE) || (test_flags & TEST_CORE_ON_SIGNAL))
@@ -2211,8 +2208,12 @@
 #endif
   sigaddset(&set,THR_SERVER_ALARM);
   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);
   pthread_sigmask(SIG_SETMASK,&set,NULL);
   DBUG_VOID_RETURN;
@@ -2276,24 +2277,20 @@
   */
   init_thr_alarm(max_connections +
 		 global_system_variables.max_insert_delayed_threads + 10);
-#if SIGINT != THR_KILL_SIGNAL
-  if (test_flags & TEST_SIGINT)
+  if (thd_lib_detected != THD_LIB_LT && (test_flags & TEST_SIGINT))
   {
     (void) sigemptyset(&set);			// Setup up SIGINT for debug
     (void) sigaddset(&set,SIGINT);		// For debugging
     (void) pthread_sigmask(SIG_UNBLOCK,&set,NULL);
   }
-#endif
   (void) sigemptyset(&set);			// Setup up SIGINT for debug
 #ifdef USE_ONE_SIGNAL_HAND
   (void) sigaddset(&set,THR_SERVER_ALARM);	// For alarms
 #endif
 #ifndef IGNORE_SIGHUP_SIGQUIT
   (void) sigaddset(&set,SIGQUIT);
-#if THR_CLIENT_ALARM != SIGHUP
   (void) sigaddset(&set,SIGHUP);
 #endif
-#endif
   (void) sigaddset(&set,SIGTERM);
   (void) sigaddset(&set,SIGTSTP);
 
@@ -2625,6 +2622,9 @@
     option we will change this value in my_tz_init().
   */
   global_system_variables.time_zone= my_tz_SYSTEM;
+
+  /* Set signal used to kill MySQL */
+  thr_kill_signal= thd_lib_detected == THD_LIB_LT ? SIGINT : SIGUSR2;
 
   /*
     Init mutexes for the global MYSQL_LOG objects.

--- 1.106/BitKeeper/etc/gone	2007-01-30 22:09:00 +02:00
+++ 1.107/BitKeeper/etc/gone	2007-01-30 22:09:00 +02:00
@@ -456,6 +456,13 @@
 ccarkner@stripped|mysql-test/r/isolation.result|20010327145543|25059|4da11e109a3d93a9
 ccarkner@stripped|mysql-test/t/isolation.test|20010327145543|39049|6a39e4138dd4a456
 fs
+jani@stripped
+jani@stripped|BUILD/SETUP.sh.rej|20070122013357|30052|b0650da46e7c4e54
+jani@stripped|configure.in.rej|20070122013357|43533|4b7ec608b9c90e83
+jani@stripped|include/my_global.h.rej|20070122013357|29911|dc7f1642f6061af
+jani@stripped|include/my_pthread.h.rej|20070122013357|18348|a6b632d992e5df16
+jani@stripped|mysys/thr_alarm.c.rej|20070122013357|21935|c169568388079966
+jani@stripped|sql/mysqld.cc.rej|20070122013357|09337|84aad00c2111bc3
 jani@stripped|client/mysqlcheck|20010419221207|26716|363e3278166d84ec
 jcole@stripped|BitKeeper/etc/logging_ok|20001004201211|30554
 jimw@stripped|mysql-test/t/ndb_alter_table.disabled|20050311230559|27526|411e026940e7a0aa
Thread
bk commit into 5.0 tree (jani:1.2390)jani30 Jan