List:Internals« Previous MessageNext Message »
From:Jim Winstead Date:September 20 2005 7:27pm
Subject:bk commit into 4.1 tree (jimw:1.2447) BUG#8731
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of jimw. When jimw 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
  1.2447 05/09/20 12:27:29 jimw@stripped +8 -0
  Fix wait_timeout handling on Mac OS X. (Bug #8731)

  mysql-test/t/wait_timeout.test
    1.1 05/09/20 12:27:26 jimw@stripped +11 -0
    New BitKeeper file ``mysql-test/t/wait_timeout.test''

  mysql-test/t/wait_timeout-master.opt
    1.1 05/09/20 12:27:26 jimw@stripped +1 -0
    New BitKeeper file ``mysql-test/t/wait_timeout-master.opt''

  mysql-test/r/wait_timeout.result
    1.1 05/09/20 12:27:26 jimw@stripped +8 -0
    New BitKeeper file ``mysql-test/r/wait_timeout.result''

  vio/vio.c
    1.23 05/09/20 12:27:26 jimw@stripped +1 -1
    Only use FIOSNBIO ioctl when FIOSNBIO is defined.

  sql/mysqld.cc
    1.598 05/09/20 12:27:26 jimw@stripped +3 -1
    Use sigaction() to set handler for THR_SERVER_ALARM so that no
    flags are set.

  mysql-test/t/wait_timeout.test
    1.0 05/09/20 12:27:26 jimw@stripped +0 -0
    BitKeeper file /home/jimw/my/mysql-4.1-8731/mysql-test/t/wait_timeout.test

  mysql-test/t/wait_timeout-master.opt
    1.0 05/09/20 12:27:26 jimw@stripped +0 -0
    BitKeeper file /home/jimw/my/mysql-4.1-8731/mysql-test/t/wait_timeout-master.opt

  mysql-test/r/wait_timeout.result
    1.0 05/09/20 12:27:26 jimw@stripped +0 -0
    BitKeeper file /home/jimw/my/mysql-4.1-8731/mysql-test/r/wait_timeout.result

  mysys/thr_alarm.c
    1.46 05/09/20 12:27:25 jimw@stripped +7 -1
    Use sigaction() to set handler for THR_SERVER_ALARM so that no
    flags are set.

  include/my_pthread.h
    1.81 05/09/20 12:27:25 jimw@stripped +1 -1
    Handle HAVE_DARWIN_THREADS rename to HAVE_DARWIN5_THREADS

  configure.in
    1.396 05/09/20 12:27:25 jimw@stripped +3 -3
    Handle HAVE_DARWIN_THREADS being renamed to HAVE_DARWIN5_THREADS and
    only enable it for Darwin 5.x, since threading was improved in later
    versions. Also add NO_FCNTL_NONBLOCK to Darwin configuration.

# 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:	jimw
# Host:	rama.(none)
# Root:	/home/jimw/my/mysql-4.1-8731

--- 1.395/configure.in	2005-09-13 11:46:53 -07:00
+++ 1.396/configure.in	2005-09-20 12:27:25 -07:00
@@ -1102,7 +1102,7 @@
   *darwin5*)
     if test "$ac_cv_prog_gcc" = "yes"
     then
-      FLAGS="-traditional-cpp -DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH"
+      FLAGS="-traditional-cpp -DHAVE_DARWIN5_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH"
       CFLAGS="$CFLAGS $FLAGS"
       CXXFLAGS="$CXXFLAGS $FLAGS"
       MAX_C_OPTIMIZE="-O"
@@ -1112,7 +1112,7 @@
   *darwin6*)
     if test "$ac_cv_prog_gcc" = "yes"
     then
-      FLAGS="-DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH"
+      FLAGS="-D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH"
       CFLAGS="$CFLAGS $FLAGS"
       CXXFLAGS="$CXXFLAGS $FLAGS"
       MAX_C_OPTIMIZE="-O"
@@ -1122,7 +1122,7 @@
     # don't forget to escape [] like above
     if test "$ac_cv_prog_gcc" = "yes"
     then
-      FLAGS="-DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT"
+      FLAGS="-D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DNO_FCNTL_NONBLOCK"
       CFLAGS="$CFLAGS $FLAGS"
       CXXFLAGS="$CXXFLAGS $FLAGS"
       MAX_C_OPTIMIZE="-O"

--- 1.80/include/my_pthread.h	2005-09-12 10:19:53 -07:00
+++ 1.81/include/my_pthread.h	2005-09-20 12:27:25 -07:00
@@ -409,7 +409,7 @@
 #define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); }
 #endif
 
-#ifdef HAVE_DARWIN_THREADS
+#ifdef HAVE_DARWIN5_THREADS
 #define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
 #define pthread_kill(A,B) pthread_dummy(0)
 #define pthread_condattr_init(A) pthread_dummy(0)

--- 1.45/mysys/thr_alarm.c	2005-06-28 05:06:11 -07:00
+++ 1.46/mysys/thr_alarm.c	2005-09-20 12:27:25 -07:00
@@ -115,7 +115,13 @@
 #endif
 #else
   pthread_sigmask(SIG_UNBLOCK, &s, NULL);
-  sigset(THR_SERVER_ALARM,process_alarm);
+  {
+    struct sigaction sact;
+    sact.sa_flags= 0;
+    bzero((char*) &sact, sizeof(sact));
+    sact.sa_handler= process_alarm;
+    sigaction(THR_SERVER_ALARM, &sact, (struct sigaction*) 0);
+  }
 #endif
   DBUG_VOID_RETURN;
 }

--- 1.597/sql/mysqld.cc	2005-09-14 04:18:11 -07:00
+++ 1.598/sql/mysqld.cc	2005-09-20 12:27:26 -07:00
@@ -2002,7 +2002,6 @@
 
   if (test_flags & TEST_SIGINT)
     sigset(THR_KILL_SIGNAL,end_thread_signal);
-  sigset(THR_SERVER_ALARM,print_signal_warning); // Should never be called!
 
   if (!(test_flags & TEST_NO_STACKTRACE) || (test_flags & TEST_CORE_ON_SIGNAL))
   {
@@ -2058,6 +2057,9 @@
   sa.sa_flags = 0;
   sa.sa_handler = print_signal_warning;
   sigaction(SIGHUP, &sa, (struct sigaction*) 0);
+  sa.sa_flags = 0;
+  sa.sa_handler = print_signal_warning;
+  sigaction(THR_SERVER_ALARM, &sa, (struct sigaction*) 0);
 #ifdef SIGTSTP
   sigaddset(&set,SIGTSTP);
 #endif
--- New file ---
+++ mysql-test/r/wait_timeout.result	05/09/20 12:27:26
select 1;
1
1
select 2;
ERROR HY000: MySQL server has gone away
select 3;
3
3

--- New file ---
+++ mysql-test/t/wait_timeout-master.opt	05/09/20 12:27:26
--wait-timeout=2

--- New file ---
+++ mysql-test/t/wait_timeout.test	05/09/20 12:27:26
#
# Bug #8731: wait_timeout does not work on Mac OS X
#
--disable_reconnect
select 1;
# wait_timeout is 2, so we should get disconnected now
--sleep 5
--error 2006
select 2;
--enable_reconnect
select 3;


--- 1.22/vio/vio.c	2005-09-07 04:57:05 -07:00
+++ 1.23/vio/vio.c	2005-09-20 12:27:26 -07:00
@@ -140,7 +140,7 @@
     fcntl(sd, F_SETFL, vio->fcntl_mode); /* Yahoo! FreeBSD patch */
 #endif
     vio->fcntl_mode = fcntl(sd, F_GETFL);
-#elif defined(HAVE_SYS_IOCTL_H)			/* hpux */
+#elif defined(HAVE_SYS_IOCTL_H) && defined(FIOSNBIO)	/* hpux */
     /* Non blocking sockets doesn't work good on HPUX 11.0 */
     (void) ioctl(sd,FIOSNBIO,0);
     vio->fcntl_mode &= ~O_NONBLOCK;
Thread
bk commit into 4.1 tree (jimw:1.2447) BUG#8731Jim Winstead20 Sep