MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Alexey Kopytov Date:May 27 2009 8:21am
Subject:bzr commit into mysql-5.1-bugteam branch (Alexey.Kopytov:2908)
Bug#44638
View as plain text  
#At file:///data/src/bzr/bugteam/bug44638/my51-bug44638/

 2908 Alexey Kopytov	2009-05-27
      Bug #44638: mysql_upgrade, mysqlcheck output instance unclear
      
      Dump all connection-related arguments when running mysqlcheck
      from mysql_upgrade.
      
      No test case, since the output depends on the test suite
      configuration and platform.
      modified:
        client/mysql_upgrade.c

per-file messages:
  client/mysql_upgrade.c
    Dump all connection-related arguments when running mysqlcheck
    from mysql_upgrade.
=== modified file 'client/mysql_upgrade.c'
--- a/client/mysql_upgrade.c	2009-05-07 17:51:55 +0000
+++ b/client/mysql_upgrade.c	2009-05-27 08:21:15 +0000
@@ -39,6 +39,7 @@ static uint my_end_arg= 0;
 static char *opt_user= (char*)"root";
 
 static DYNAMIC_STRING ds_args;
+static DYNAMIC_STRING conn_args;
 
 static char *opt_password= 0;
 static my_bool tty_password= 0;
@@ -135,6 +136,7 @@ static void free_used_memory(void)
   free_defaults(defaults_argv);
 
   dynstr_free(&ds_args);
+  dynstr_free(&conn_args);
 }
 
 
@@ -204,7 +206,7 @@ static void add_one_option(DYNAMIC_STRIN
     }
   }
   dynstr_append_os_quoted(ds, "--", opt->name, eq, arg, NullS);
-  dynstr_append(&ds_args, " ");
+  dynstr_append(ds, " ");
 }
 
 
@@ -256,6 +258,15 @@ get_one_option(int optid, const struct m
   case 'f': /* --force     */
     add_option= FALSE;
     break;
+
+  case 'h': /* --host */
+  case 'W': /* --pipe */
+  case 'P': /* --port */
+  case 'S': /* --socket */
+  case OPT_MYSQL_PROTOCOL: /* --protocol */
+  case OPT_SHARED_MEMORY_BASE_NAME: /* --shared-memory-base-name */
+    add_one_option(&conn_args, opt, argument);
+    break;
   }
 
   if (add_option)
@@ -604,13 +615,27 @@ static void create_mysql_upgrade_info_fi
 
 
 /*
+  Print connection-related arguments.
+*/
+
+static void print_conn_args(const char *tool_name)
+{
+  if (conn_args.str[0])
+    verbose("Running '%s' with connection arguments: %s", tool_name,
+          conn_args.str);
+  else
+    verbose("Running '%s with default connection arguments", tool_name);
+}  
+
+
+/*
   Check and upgrade(if neccessary) all tables
   in the server using "mysqlcheck --check-upgrade .."
 */
 
 static int run_mysqlcheck_upgrade(void)
 {
-  verbose("Running 'mysqlcheck'...");
+  print_conn_args("mysqlcheck");
   return run_tool(mysqlcheck_path,
                   NULL, /* Send output from mysqlcheck directly to screen */
                   "--no-defaults",
@@ -624,7 +649,7 @@ static int run_mysqlcheck_upgrade(void)
 
 static int run_mysqlcheck_fixnames(void)
 {
-  verbose("Running 'mysqlcheck'...");
+  print_conn_args("mysqlcheck");
   return run_tool(mysqlcheck_path,
                   NULL, /* Send output from mysqlcheck directly to screen */
                   "--no-defaults",
@@ -753,7 +778,8 @@ int main(int argc, char **argv)
     strncpy(self_name, argv[0], FN_REFLEN);
   }
 
-  if (init_dynamic_string(&ds_args, "", 512, 256))
+  if (init_dynamic_string(&ds_args, "", 512, 256) ||
+      init_dynamic_string(&conn_args, "", 512, 256))
     die("Out of memory");
 
   load_defaults("my", load_default_groups, &argc, &argv);

Thread
bzr commit into mysql-5.1-bugteam branch (Alexey.Kopytov:2908)Bug#44638Alexey Kopytov27 May