List:Commits« Previous MessageNext Message »
From:Alexander Nozdrin Date:June 18 2009 6:55am
Subject:bzr commit into mysql-5.4 branch (alik:2798) Bug#38992
View as plain text  
#At file:///mnt/raid/alik/MySQL/bzr/bug38992/azalea-bug38992/ based on revid:alik@stripped

 2798 Alexander Nozdrin	2009-06-18
      Fix for Bug#38992: Server crashes sporadically with
      'waiting for initial ...' msg on windows.
      
      The problem is that connection timeout is too small
      for busy windows box.
      
      The fix is to
        - add support for connect_timeout command line argument
          to mysqltest;
        - increase connection timeout to 120 seconds.

    modified:
      client/mysqltest.cc
=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc	2009-05-11 17:58:07 +0000
+++ b/client/mysqltest.cc	2009-06-18 06:55:40 +0000
@@ -114,6 +114,8 @@ static uint my_end_arg= 0;
 /* Number of lines of the result to include in failure report */
 static uint opt_tail_lines= 0;
 
+static uint opt_connect_timeout= 0;
+
 static char delimiter[MAX_DELIMITER_LENGTH]= ";";
 static uint delimiter_length= 1;
 
@@ -4994,6 +4996,11 @@ void do_connect(struct st_command *comma
 #endif
   if (!mysql_init(&con_slot->mysql))
     die("Failed on mysql_init()");
+
+  if (opt_connect_timeout)
+    mysql_options(&con_slot->mysql, MYSQL_OPT_CONNECT_TIMEOUT,
+                  (void *) &opt_connect_timeout);
+
   if (opt_compress || con_compress)
     mysql_options(&con_slot->mysql, MYSQL_OPT_COMPRESS, NullS);
   mysql_options(&con_slot->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
@@ -5769,6 +5776,11 @@ static struct my_option my_long_options[
   {"view-protocol", OPT_VIEW_PROTOCOL, "Use views for select",
    (uchar**) &view_protocol, (uchar**) &view_protocol, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"connect_timeout", OPT_CONNECT_TIMEOUT,
+   "Number of seconds before connection timeout.",
+   (uchar**) &opt_connect_timeout,
+   (uchar**) &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG,
+   120, 0, 3600 * 12, 0, 0, 0},
   { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
 };
 
@@ -6992,6 +7004,10 @@ int util_query(MYSQL* org_mysql, const c
     if (!(mysql= mysql_init(mysql)))
       die("Failed in mysql_init()");
 
+    if (opt_connect_timeout)
+      mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT,
+                    (void *) &opt_connect_timeout);
+
     /* enable local infile, in non-binary builds often disabled by default */
     mysql_options(mysql, MYSQL_OPT_LOCAL_INFILE, 0);
     safe_connect(mysql, "util", org_mysql->host, org_mysql->user,
@@ -7649,6 +7665,9 @@ int main(int argc, char **argv)
   st_connection *con= connections;
   if (!( mysql_init(&con->mysql)))
     die("Failed in mysql_init()");
+  if (opt_connect_timeout)
+    mysql_options(&con->mysql, MYSQL_OPT_CONNECT_TIMEOUT,
+                  (void *) &opt_connect_timeout);
   if (opt_compress)
     mysql_options(&con->mysql,MYSQL_OPT_COMPRESS,NullS);
   mysql_options(&con->mysql, MYSQL_OPT_LOCAL_INFILE, 0);


Attachment: [text/bzr-bundle] bzr/alik@sun.com-20090618065540-1o75n74d4uxujbxa.bundle
Thread
bzr commit into mysql-5.4 branch (alik:2798) Bug#38992Alexander Nozdrin19 Jun