Loading client/mysqladmin.c +8 −2 Original line number Diff line number Diff line Loading @@ -253,10 +253,16 @@ int main(int argc,char *argv[]) int error, ho_error; MYSQL mysql; char **commands; char** save_argv; MY_INIT(argv[0]); mysql_init(&mysql); load_defaults("my",load_default_groups,&argc,&argv); save_argv = argv; /* Sasha: with the change to handle_options() we now need to do this fix with save_argv in all client utilities. The problem is that handle_options may modify argv, and that wreaks havoc with free_defaults() */ if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) { printf("%s: handle_options() failed with error %d\n", my_progname, Loading Loading @@ -327,7 +333,7 @@ int main(int argc,char *argv[]) } my_free(opt_password,MYF(MY_ALLOW_ZERO_PTR)); my_free(user,MYF(MY_ALLOW_ZERO_PTR)); free_defaults(argv); free_defaults(save_argv); my_end(0); exit(error ? 1 : 0); return 0; Loading libmysql/Makefile.shared +2 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,8 @@ mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \ my_compress.lo array.lo my_once.lo list.lo my_net.lo \ charset.lo hash.lo mf_iocache.lo \ mf_iocache2.lo my_seek.lo \ my_pread.lo mf_cache.lo my_vsnprintf.lo md5.lo my_pread.lo mf_cache.lo my_vsnprintf.lo md5.lo \ my_getopt.lo # Not needed in the minimum library mysysobjects2 = getopt.lo getopt1.lo getvar.lo my_lib.lo Loading mysys/my_getopt.c +7 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,12 @@ int handle_options(int *argc, char ***argv, cur_arg= *pos; (*argc)--; } /* Sasha: quick dirty fix of a bug that coredumps mysqladmin while running the test suite. The bug is actually pretty serious - even in cases when we do not coredump, -O var=val will not set the variable, and the previous option would be treated upredictably. */ goto found_var; } else if (*cur_arg == '-') /* check for long option, or --set-variable */ { Loading Loading @@ -145,6 +151,7 @@ int handle_options(int *argc, char ***argv, continue; } } found_var: optend= strcend(cur_arg, '='); length= optend - cur_arg; if (*optend == '=') Loading Loading
client/mysqladmin.c +8 −2 Original line number Diff line number Diff line Loading @@ -253,10 +253,16 @@ int main(int argc,char *argv[]) int error, ho_error; MYSQL mysql; char **commands; char** save_argv; MY_INIT(argv[0]); mysql_init(&mysql); load_defaults("my",load_default_groups,&argc,&argv); save_argv = argv; /* Sasha: with the change to handle_options() we now need to do this fix with save_argv in all client utilities. The problem is that handle_options may modify argv, and that wreaks havoc with free_defaults() */ if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) { printf("%s: handle_options() failed with error %d\n", my_progname, Loading Loading @@ -327,7 +333,7 @@ int main(int argc,char *argv[]) } my_free(opt_password,MYF(MY_ALLOW_ZERO_PTR)); my_free(user,MYF(MY_ALLOW_ZERO_PTR)); free_defaults(argv); free_defaults(save_argv); my_end(0); exit(error ? 1 : 0); return 0; Loading
libmysql/Makefile.shared +2 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,8 @@ mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \ my_compress.lo array.lo my_once.lo list.lo my_net.lo \ charset.lo hash.lo mf_iocache.lo \ mf_iocache2.lo my_seek.lo \ my_pread.lo mf_cache.lo my_vsnprintf.lo md5.lo my_pread.lo mf_cache.lo my_vsnprintf.lo md5.lo \ my_getopt.lo # Not needed in the minimum library mysysobjects2 = getopt.lo getopt1.lo getvar.lo my_lib.lo Loading
mysys/my_getopt.c +7 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,12 @@ int handle_options(int *argc, char ***argv, cur_arg= *pos; (*argc)--; } /* Sasha: quick dirty fix of a bug that coredumps mysqladmin while running the test suite. The bug is actually pretty serious - even in cases when we do not coredump, -O var=val will not set the variable, and the previous option would be treated upredictably. */ goto found_var; } else if (*cur_arg == '-') /* check for long option, or --set-variable */ { Loading Loading @@ -145,6 +151,7 @@ int handle_options(int *argc, char ***argv, continue; } } found_var: optend= strcend(cur_arg, '='); length= optend - cur_arg; if (*optend == '=') Loading