Update my_print_defaults to accept --mariadbd as an option

--mariadbd and --mysqld are now synonymes for my_print_defaults

Other things
- Removed safemalloc warnings when using an unknown argument to
  my_print_defaults
This commit is contained in:
Monty 2024-11-25 10:31:37 +02:00
parent f09020b3bb
commit 142851f120

View file

@ -62,7 +62,9 @@ static struct my_option my_long_options[] =
"In addition to the given groups, read also groups with this suffix",
(char**) &my_defaults_group_suffix, (char**) &my_defaults_group_suffix,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"mysqld", 0, "Read the same set of groups that the mysqld binary does.",
{"mysqld", 0, "Read the same set of groups that the mariadbd (previously known as mysqld) binary does.",
&opt_mysqld, &opt_mysqld, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"mariadbd", 0, "Read the same set of groups that the mariadbd binary does.",
&opt_mysqld, &opt_mysqld, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"no-defaults", 'n', "Return an empty string (useful for scripts).",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@ -84,7 +86,7 @@ static void cleanup_and_exit(int exit_code)
static void version()
{
printf("%s Ver 1.7 for %s at %s\n",my_progname,SYSTEM_TYPE, MACHINE_TYPE);
printf("%s Ver 1.8 for %s at %s\n",my_progname,SYSTEM_TYPE, MACHINE_TYPE);
}
@ -136,7 +138,7 @@ static int get_options(int *argc,char ***argv)
int ho_error;
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
exit(ho_error);
cleanup_and_exit(ho_error);
return 0;
}
@ -195,7 +197,8 @@ int main(int argc, char **argv)
load_default_groups=(char**) my_malloc(PSI_NOT_INSTRUMENTED,
nargs*sizeof(char*), MYF(MY_WME));
if (!load_default_groups)
exit(1);
cleanup_and_exit(1);
if (opt_mysqld)
{
for (; mysqld_groups[i]; i++)