diff options
author | Alexey Botchkov <holyfoot@mysql.com> | 2009-10-09 19:44:22 +0500 |
---|---|---|
committer | Alexey Botchkov <holyfoot@mysql.com> | 2009-10-09 19:44:22 +0500 |
commit | de7619823d3846fa514d7f540a7e5af898b142a8 (patch) | |
tree | f7806c6b127e5edc89d1c9a12b7a3492bc6a9219 /client | |
parent | edd89cf7f75df785b3c59f5c72a853bcb4dc31ca (diff) | |
download | mariadb-git-de7619823d3846fa514d7f540a7e5af898b142a8.tar.gz |
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
Diffstat (limited to 'client')
-rw-r--r-- | client/mysql.cc | 6 | ||||
-rw-r--r-- | client/mysql_upgrade.c | 3 | ||||
-rw-r--r-- | client/mysqladmin.cc | 3 | ||||
-rw-r--r-- | client/mysqlbinlog.cc | 4 | ||||
-rw-r--r-- | client/mysqlcheck.c | 5 | ||||
-rw-r--r-- | client/mysqldump.c | 3 | ||||
-rw-r--r-- | client/mysqlimport.c | 3 | ||||
-rw-r--r-- | client/mysqlshow.c | 4 | ||||
-rw-r--r-- | client/mysqlslap.c | 6 | ||||
-rw-r--r-- | client/mysqltest.cc | 4 |
10 files changed, 28 insertions, 13 deletions
diff --git a/client/mysql.cc b/client/mysql.cc index 28da6d75c1b..99ba42f20a8 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -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)) { diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index 52c3636219d..1634803edf5 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -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)) diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index 2b93c149523..cf8cf85a112 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -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))) { diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index ebe34231238..80b0d2fc3d7 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -1349,8 +1349,8 @@ static int parse_args(int *argc, char*** argv) 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; diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index 1533e602639..b56016b6a35 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -344,9 +344,8 @@ static int get_options(int *argc, char ***argv) 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) diff --git a/client/mysqldump.c b/client/mysqldump.c index e9e3124b9cb..16dcb53cae1 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -858,7 +858,8 @@ static int get_options(int *argc, char ***argv) 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, diff --git a/client/mysqlimport.c b/client/mysqlimport.c index ef38d760e5d..53c889f0758 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -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)) diff --git a/client/mysqlshow.c b/client/mysqlshow.c index 15f791ca8fb..b6c8c5fc992 100644 --- a/client/mysqlshow.c +++ b/client/mysqlshow.c @@ -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; diff --git a/client/mysqlslap.c b/client/mysqlslap.c index 5983b911866..759a745cbe6 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -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)) { diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 04a7e7b0c6f..ae3442a22a9 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -5931,7 +5931,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), 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))) |