List:Commits« Previous MessageNext Message »
From:Mikael Ronstrom Date:November 20 2009 7:03pm
Subject:bzr push into mysql-5.6-next-mr branch (mikael:2945)
View as plain text  
 2945 Mikael Ronstrom	2009-11-20 [merge]
      Merge

    added:
      mysql-test/r/partition_sync.result
      mysql-test/r/rpl_mysqldump_slave.result
      mysql-test/t/partition_sync.test
      mysql-test/t/rpl_mysqldump_slave.test
    modified:
      .bzr-mysql/default.conf
      client/client_priv.h
      client/mysql.cc
      client/mysqladmin.cc
      client/mysqlcheck.c
      client/mysqldump.c
      client/mysqltest.cc
      client/sql_string.cc
      client/sql_string.h
      config/ac-macros/misc.m4
      configure.in
      include/m_string.h
      include/mysql_com.h
      include/violite.h
      libmysql/libmysql.c
      libmysqld/lib_sql.cc
      mysql-test/lib/My/ConfigFactory.pm
      mysql-test/r/alias.result
      mysql-test/r/delete.result
      mysql-test/r/derived.result
      mysql-test/r/dirty_close.result
      mysql-test/r/func_sapdb.result
      mysql-test/r/func_time.result
      mysql-test/r/loadxml.result
      mysql-test/r/mysql.result
      mysql-test/r/sp-error.result
      mysql-test/r/sp.result
      mysql-test/r/trigger.result
      mysql-test/r/type_time.result
      mysql-test/suite/rpl/r/rpl_multi_delete2.result
      mysql-test/suite/rpl/t/rpl_multi_delete2.test
      mysql-test/suite/sys_vars/r/group_concat_max_len_func.result
      mysql-test/t/alias.test
      mysql-test/t/delete.test
      mysql-test/t/derived.test
      mysql-test/t/dirty_close.test
      mysql-test/t/func_sapdb.test
      mysql-test/t/func_time.test
      mysql-test/t/loadxml.test
      mysql-test/t/lock_multi.test
      mysql-test/t/mysql.test
      mysql-test/t/shm.test
      mysql-test/t/sp-error.test
      mysql-test/t/sp.test
      mysql-test/t/trigger.test
      mysql-test/t/type_time.test
      mysys/my_alloc.c
      mysys/my_getopt.c
      sql/event_data_objects.cc
      sql/field.cc
      sql/field.h
      sql/ha_partition.cc
      sql/item_cmpfunc.cc
      sql/item_func.cc
      sql/item_subselect.cc
      sql/item_timefunc.cc
      sql/mysql_priv.h
      sql/opt_sum.cc
      sql/share/errmsg.txt
      sql/sp.cc
      sql/sp_head.cc
      sql/sql_cache.cc
      sql/sql_class.h
      sql/sql_insert.cc
      sql/sql_list.h
      sql/sql_parse.cc
      sql/sql_partition.cc
      sql/sql_select.cc
      sql/sql_servers.cc
      sql/sql_show.cc
      sql/sql_string.cc
      sql/sql_string.h
      sql/sql_trigger.cc
      sql/sql_update.cc
      sql/sql_yacc.yy
      sql/table.h
      sql/tztime.cc
      storage/myisam/mi_dynrec.c
      storage/ndb/include/kernel/signaldata/DictTabInfo.hpp
      strings/ctype-bin.c
      strings/ctype-latin1.c
      strings/ctype-mb.c
      strings/ctype-simple.c
      vio/vio.c
      vio/vio_priv.h
      vio/viosocket.c
=== modified file 'configure.in'
--- a/configure.in	2009-11-12 03:11:55 +0000
+++ b/configure.in	2009-11-20 17:12:00 +0000
@@ -859,9 +859,72 @@ AC_CHECK_DECLS(MHA_MAPSIZE_VA,
 #include <sys/mman.h>
       ]
 )
+fi
+
+dnl Use of ALARMs to wakeup on timeout on sockets
+dnl
+dnl This feature makes use of a mutex and is a scalability hog we
+dnl try to avoid using. However we need support for SO_SNDTIMEO and
+dnl SO_RCVTIMEO socket options for this to work. So we will check
+dnl if this feature is supported by a simple AC_RUN_IFELSE macro. However
+dnl on some OS's there is support for setting those variables but
+dnl they are silently ignored. For those OS's we will not attempt
+dnl o use SO_SNDTIMEO and SO_RCVTIMEO even if it is said to work.
+dnl See Bug#29093 for the problem with SO_SND/RCVTIMEO on HP/UX.
+dnl To use alarm is simple, simply avoid setting anything.
+
+
+AC_CACHE_CHECK([whether SO_SNDTIMEO and SO_RCVTIMEO work],
+  [mysql_cv_socket_timeout],
+  [AC_RUN_IFELSE(
+    [AC_LANG_PROGRAM([[
+      #include <sys/types.h>
+      #include <sys/socket.h>
+      #include <sys/time.h>
+    ]],[[
+      int fd = socket(AF_INET, SOCK_STREAM, 0);
+      struct timeval tv;
+      int ret= 0;
+      tv.tv_sec= 2;
+      tv.tv_usec= 0;
+      ret|= setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
+      ret|= setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
+      return !!ret;
+    ]])],
+    [mysql_cv_socket_timeout=yes],
+    [mysql_cv_socket_timeout=no],
+    [mysql_cv_socket_timeout=no
+     AC_MSG_WARN([Socket timeout options disabled due to cross-compiling])])
+  ])
+
+use_alarm=yes
 
+if test "$mysql_cv_socket_timeout" = yes; then
+  case $SYSTEM_TYPE in
+    dnl We trust the result from the following systems
+    *solaris*) use_alarm=no ;;
+    *freebsd*) use_alarm=no ;;
+    *darwin*)  use_alarm=no ;;
+    *)
+      dnl We trust the result from Linux also
+      if test "$TARGET_LINUX" = "true"; then
+        use_alarm=no
+      fi
+      dnl We trust no one else for the moment
+      dnl (Windows is hardcoded to not use alarms)
+      ;;
+  esac
+fi
 
+AC_ARG_WITH(alarm,
+    AS_HELP_STRING([--with-alarm], [Use alarm to implement socket timeout.]),
+    [use_alarm=$withval], [])
+
+AC_MSG_CHECKING(whether to use alarms to implement socket timeout)
+if test "$use_alarm" = no ; then
+  AC_DEFINE([NO_ALARM], [1], [No need to use alarm for socket timeout])
 fi
+AC_MSG_RESULT($use_alarm)
 
 #--------------------------------------------------------------------
 # Check for TCP wrapper support

=== modified file 'sql/net_serv.cc'
--- a/sql/net_serv.cc	2009-11-02 11:10:04 +0000
+++ b/sql/net_serv.cc	2009-11-12 11:17:31 +0000
@@ -71,8 +71,10 @@
 
 #if defined(__WIN__) || !defined(MYSQL_SERVER)
   /* The following is because alarms doesn't work on windows. */
+#ifndef NO_ALARM
 #define NO_ALARM
 #endif
+#endif
 
 #ifndef NO_ALARM
 #include "my_pthread.h"


Attachment: [text/bzr-bundle] bzr/mikael@mysql.com-20091120171200-g8w32k3pzcx2fpuc.bundle
Thread
bzr push into mysql-5.6-next-mr branch (mikael:2945) Mikael Ronstrom20 Nov