MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Alexey Botchkov Date:October 9 2009 2:45pm
Subject:bzr commit into mysql-5.1-bugteam branch (holyfoot:3150) Bug#47216
View as plain text  
#At file:///home/hf/work/mysql_common/47216/ based on revid:magnus.blaudd@stripped

 3150 Alexey Botchkov	2009-10-09
      Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
          added code to exit a tool if the forced config file wasn't found
      
      per-file comments:
        client/mysql.cc
      Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
          added code to exit a tool if the forced config file wasn't found
        client/mysql_upgrade.c
      Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
          added code to exit a tool if the forced config file wasn't found
        client/mysqladmin.cc
      Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
          added code to exit a tool if the forced config file wasn't found
        client/mysqlcheck.c
      Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
          added code to exit a tool if the forced config file wasn't found
        client/mysqldump.c
      Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
          added code to exit a tool if the forced config file wasn't found
        client/mysqlimport.c
      Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
          added code to exit a tool if the forced config file wasn't found
        client/mysqlshow.c
      Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
          added code to exit a tool if the forced config file wasn't found
        client/mysqlslap.c
      Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
          added code to exit a tool if the forced config file wasn't found
        mysql-test/t/mysql.test
      Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
         test added
        sql/mysqld.cc
      Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
          added code to exit a tool if the forced config file wasn't found
        storage/myisam/myisamchk.c
      Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
          added code to exit a tool if the forced config file wasn't found
        storage/myisam/myisampack.c
      Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
          added code to exit a tool if the forced config file wasn't found

    modified:
      client/mysql.cc
      client/mysql_upgrade.c
      client/mysqladmin.cc
      client/mysqlbinlog.cc
      client/mysqlcheck.c
      client/mysqldump.c
      client/mysqlimport.c
      client/mysqlshow.c
      client/mysqlslap.c
      client/mysqltest.cc
      extra/my_print_defaults.c
      mysys/default.c
      sql/mysqld.cc
      storage/archive/archive_reader.c
      storage/myisam/myisamchk.c
      storage/myisam/myisampack.c
      tests/mysql_client_test.c
      tests/thread_test.c
=== modified file 'client/mysql.cc'
--- a/client/mysql.cc	2009-09-23 13:21:29 +0000
+++ b/client/mysql.cc	2009-10-09 14:44:22 +0000
@@ -1113,7 +1113,11 @@ int main(int argc,char *argv[])
       close(stdout_fileno_copy);             /* Clean up dup(). */
   }
 
-  load_defaults("my",load_default_groups,&argc,&argv);
+  if (load_defaults("my",load_default_groups,&argc,&argv))
+  {
+    my_end(0);
+    exit(1);
+  }
   defaults_argv=argv;
   if (get_options(argc, (char **) argv))
   {

=== modified file 'client/mysql_upgrade.c'
--- a/client/mysql_upgrade.c	2009-09-28 06:24:19 +0000
+++ b/client/mysql_upgrade.c	2009-10-09 14:44:22 +0000
@@ -814,7 +814,8 @@ int main(int argc, char **argv)
       init_dynamic_string(&conn_args, "", 512, 256))
     die("Out of memory");
 
-  load_defaults("my", load_default_groups, &argc, &argv);
+  if (load_defaults("my", load_default_groups, &argc, &argv))
+    die(NULL);
   defaults_argv= argv; /* Must be freed by 'free_defaults' */
 
   if (handle_options(&argc, &argv, my_long_options, get_one_option))

=== modified file 'client/mysqladmin.cc'
--- a/client/mysqladmin.cc	2009-08-31 19:40:33 +0000
+++ b/client/mysqladmin.cc	2009-10-09 14:44:22 +0000
@@ -304,7 +304,8 @@ int main(int argc,char *argv[])
 
   MY_INIT(argv[0]);
   mysql_init(&mysql);
-  load_defaults("my",load_default_groups,&argc,&argv);
+  if (load_defaults("my",load_default_groups,&argc,&argv))
+   exit(1); 
   save_argv = argv;				/* Save for free_defaults */
   if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
   {

=== modified file 'client/mysqlbinlog.cc'
--- a/client/mysqlbinlog.cc	2009-09-30 02:31:25 +0000
+++ b/client/mysqlbinlog.cc	2009-10-09 14:44:22 +0000
@@ -1349,8 +1349,8 @@ static int parse_args(int *argc, char***
   int ho_error;
 
   result_file = stdout;
-  load_defaults("my",load_default_groups,argc,argv);
-  if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
+  if ((ho_error= load_defaults("my",load_default_groups,argc,argv)) ||
+      (ho_error= handle_options(argc, argv, my_long_options, get_one_option)))
     exit(ho_error);
   if (debug_info_flag)
     my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO;

=== modified file 'client/mysqlcheck.c'
--- a/client/mysqlcheck.c	2009-09-28 06:24:19 +0000
+++ b/client/mysqlcheck.c	2009-10-09 14:44:22 +0000
@@ -344,9 +344,8 @@ static int get_options(int *argc, char *
     exit(0);
   }
 
-  load_defaults("my", load_default_groups, argc, argv);
-
-  if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
+  if ((ho_error= load_defaults("my", load_default_groups, argc, argv)) ||
+      (ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
     exit(ho_error);
 
   if (!what_to_do)

=== modified file 'client/mysqldump.c'
--- a/client/mysqldump.c	2009-08-28 15:06:59 +0000
+++ b/client/mysqldump.c	2009-10-09 14:44:22 +0000
@@ -858,7 +858,8 @@ static int get_options(int *argc, char *
   opt_net_buffer_length= *mysql_params->p_net_buffer_length;
 
   md_result_file= stdout;
-  load_defaults("my",load_default_groups,argc,argv);
+  if (load_defaults("my",load_default_groups,argc,argv))
+    return 1;
   defaults_argv= *argv;
 
   if (hash_init(&ignore_table, charset_info, 16, 0, 0,

=== modified file 'client/mysqlimport.c'
--- a/client/mysqlimport.c	2009-09-17 16:34:24 +0000
+++ b/client/mysqlimport.c	2009-10-09 14:44:22 +0000
@@ -596,7 +596,8 @@ int main(int argc, char **argv)
   char **argv_to_free;
   MY_INIT(argv[0]);
 
-  load_defaults("my",load_default_groups,&argc,&argv);
+  if (load_defaults("my",load_default_groups,&argc,&argv))
+    return 1;
   /* argv is changed in the program */
   argv_to_free= argv;
   if (get_options(&argc, &argv))

=== modified file 'client/mysqlshow.c'
--- a/client/mysqlshow.c	2009-06-03 11:18:12 +0000
+++ b/client/mysqlshow.c	2009-10-09 14:44:22 +0000
@@ -63,7 +63,9 @@ int main(int argc, char **argv)
   char *wild;
   MYSQL mysql;
   MY_INIT(argv[0]);
-  load_defaults("my",load_default_groups,&argc,&argv);
+  if (load_defaults("my",load_default_groups,&argc,&argv))
+    exit(1);
+
   get_options(&argc,&argv);
 
   wild=0;

=== modified file 'client/mysqlslap.c'
--- a/client/mysqlslap.c	2009-10-04 09:15:05 +0000
+++ b/client/mysqlslap.c	2009-10-09 14:44:22 +0000
@@ -299,7 +299,11 @@ int main(int argc, char **argv)
 
   MY_INIT(argv[0]);
 
-  load_defaults("my",load_default_groups,&argc,&argv);
+  if (load_defaults("my",load_default_groups,&argc,&argv))
+  {
+    my_end(0);
+    exit(1);
+  }
   defaults_argv=argv;
   if (get_options(&argc,&argv))
   {

=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc	2009-10-05 12:57:59 +0000
+++ b/client/mysqltest.cc	2009-10-09 14:44:22 +0000
@@ -5931,7 +5931,9 @@ get_one_option(int optid, const struct m
 
 int parse_args(int argc, char **argv)
 {
-  load_defaults("my",load_default_groups,&argc,&argv);
+  if (load_defaults("my",load_default_groups,&argc,&argv))
+    exit(1);
+
   default_argv= argv;
 
   if ((handle_options(&argc, &argv, my_long_options, get_one_option)))

=== modified file 'extra/my_print_defaults.c'
--- a/extra/my_print_defaults.c	2007-05-10 09:59:39 +0000
+++ b/extra/my_print_defaults.c	2009-10-09 14:44:22 +0000
@@ -189,6 +189,7 @@ int main(int argc, char **argv)
 		config_file);
     }
     error= 2;
+    exit(error);
   }
 
   for (argument= arguments+1 ; *argument ; argument++)
@@ -196,5 +197,5 @@ int main(int argc, char **argv)
   my_free((char*) load_default_groups,MYF(0));
   free_defaults(arguments);
 
-  exit(error);
+  exit(0);
 }

=== modified file 'mysys/default.c'
--- a/mysys/default.c	2009-03-24 13:58:52 +0000
+++ b/mysys/default.c	2009-10-09 14:44:22 +0000
@@ -479,9 +479,13 @@ int my_load_defaults(const char *conf_fi
   ctx.args= &args;
   ctx.group= &group;
 
-  error= my_search_option_files(conf_file, argc, argv, &args_used,
-                                handle_default_option, (void *) &ctx,
-                                dirs);
+  if ((error= my_search_option_files(conf_file, argc, argv, &args_used,
+                                     handle_default_option, (void *) &ctx,
+                                     dirs)))
+  {
+    free_root(&alloc,MYF(0));
+    DBUG_RETURN(error);
+  }
   /*
     Here error contains <> 0 only if we have a fully specified conf_file
     or a forced default file
@@ -528,10 +532,10 @@ int my_load_defaults(const char *conf_fi
     exit(0);
   }
 
-  if (error == 0 && default_directories)
+  if (default_directories)
     *default_directories= dirs;
 
-  DBUG_RETURN(error);
+  DBUG_RETURN(0);
 
  err:
   fprintf(stderr,"Fatal error in defaults handling. Program aborted\n");

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2009-09-29 15:38:40 +0000
+++ b/sql/mysqld.cc	2009-10-09 14:44:22 +0000
@@ -3283,7 +3283,8 @@ static int init_common_variables(const c
 
   orig_argc=argc;
   orig_argv=argv;
-  load_defaults(conf_file_name, groups, &argc, &argv);
+  if (load_defaults(conf_file_name, groups, &argc, &argv))
+    return 1;
   defaults_argv=argv;
   defaults_argc=argc;
   if (get_options(&defaults_argc, defaults_argv))

=== modified file 'storage/archive/archive_reader.c'
--- a/storage/archive/archive_reader.c	2008-11-25 02:04:58 +0000
+++ b/storage/archive/archive_reader.c	2009-10-09 14:44:22 +0000
@@ -390,7 +390,8 @@ static void print_version(void)
 
 static void get_options(int *argc, char ***argv)
 {
-  load_defaults("my", load_default_groups, argc, argv);
+  if (load_defaults("my", load_default_groups, argc, argv))
+    exit(1);
   default_argv= *argv;
 
   handle_options(argc, argv, my_long_options, get_one_option);

=== modified file 'storage/myisam/myisamchk.c'
--- a/storage/myisam/myisamchk.c	2009-09-29 15:38:40 +0000
+++ b/storage/myisam/myisamchk.c	2009-10-09 14:44:22 +0000
@@ -740,7 +740,9 @@ static void get_options(register int *ar
 {
   int ho_error;
 
-  load_defaults("my", load_default_groups, argc, argv);
+  if (load_defaults("my", load_default_groups, argc, argv))
+    exit(1);
+
   default_argv= *argv;
   if (isatty(fileno(stdout)))
     check_param.testflag|=T_WRITE_LOOP;

=== modified file 'storage/myisam/myisampack.c'
--- a/storage/myisam/myisampack.c	2008-11-14 16:29:38 +0000
+++ b/storage/myisam/myisampack.c	2009-10-09 14:44:22 +0000
@@ -208,7 +208,9 @@ int main(int argc, char **argv)
   char **default_argv;
   MY_INIT(argv[0]);
 
-  load_defaults("my",load_default_groups,&argc,&argv);
+  if (load_defaults("my",load_default_groups,&argc,&argv))
+    exit(1);
+
   default_argv= argv;
   get_options(&argc,&argv);
 

=== modified file 'tests/mysql_client_test.c'
--- a/tests/mysql_client_test.c	2009-09-02 10:09:01 +0000
+++ b/tests/mysql_client_test.c	2009-10-09 14:44:22 +0000
@@ -18458,7 +18458,9 @@ int main(int argc, char **argv)
 
   MY_INIT(argv[0]);
 
-  load_defaults("my", client_test_load_default_groups, &argc, &argv);
+  if (load_defaults("my", client_test_load_default_groups, &argc, &argv))
+    exit(1);
+
   defaults_argv= argv;
   get_options(&argc, &argv);
 

=== modified file 'tests/thread_test.c'
--- a/tests/thread_test.c	2007-09-15 02:09:38 +0000
+++ b/tests/thread_test.c	2009-10-09 14:44:22 +0000
@@ -176,9 +176,8 @@ static void get_options(int argc, char *
 {
   int ho_error;
 
-  load_defaults("my",load_default_groups,&argc,&argv);
-
-  if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
+  if ((ho_error= load_defaults("my",load_default_groups,&argc,&argv)) ||
+      (ho_error= handle_options(&argc, &argv, my_long_options, get_one_option)))
     exit(ho_error);
 
   free_defaults(argv);


Attachment: [text/bzr-bundle] bzr/holyfoot@mysql.com-20091009144422-juzx73pxhntk6cdg.bundle
Thread
bzr commit into mysql-5.1-bugteam branch (holyfoot:3150) Bug#47216Alexey Botchkov9 Oct