Commit c37aa34a authored by unknown's avatar unknown

Fixed a bug in my_getopt and mysqld.cc

parent e56ad0cf
...@@ -50386,6 +50386,10 @@ each individual 4.0.x release. ...@@ -50386,6 +50386,10 @@ each individual 4.0.x release.
@itemize @bullet @itemize @bullet
@item @item
Fixed a bug in my_getopt; --set-variable syntax didn't work for
those options that didn't have a valid variable in my_option struct.
This affected at least @code{default-table-type} option.
@item
Fixed a bug that caused @code{REPAIR TABLE} to fail on tables Fixed a bug that caused @code{REPAIR TABLE} to fail on tables
with duplicates in a unique key. with duplicates in a unique key.
@item @item
...@@ -275,7 +275,7 @@ int handle_options(int *argc, char ***argv, ...@@ -275,7 +275,7 @@ int handle_options(int *argc, char ***argv,
return EXIT_AMBIGUOUS_OPTION; return EXIT_AMBIGUOUS_OPTION;
} }
} }
if (must_be_var && !optp->value) if (must_be_var && optp->var_type == GET_NO_ARG)
{ {
if (my_getopt_print_errors) if (my_getopt_print_errors)
fprintf(stderr, "%s: option '%s' cannot take an argument\n", fprintf(stderr, "%s: option '%s' cannot take an argument\n",
......
...@@ -3000,7 +3000,7 @@ struct my_option my_long_options[] = ...@@ -3000,7 +3000,7 @@ struct my_option my_long_options[] =
REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{"default-table-type", OPT_TABLE_TYPE, {"default-table-type", OPT_TABLE_TYPE,
"Set the default table type for tables", 0, 0, "Set the default table type for tables", 0, 0,
0, GET_NO_ARG, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"delay-key-write", OPT_DELAY_KEY_WRITE, "Type of DELAY_KEY_WRITE", {"delay-key-write", OPT_DELAY_KEY_WRITE, "Type of DELAY_KEY_WRITE",
0,0,0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, 0,0,0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"delay-key-write-for-all-tables", OPT_DELAY_KEY_WRITE_ALL, {"delay-key-write-for-all-tables", OPT_DELAY_KEY_WRITE_ALL,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment