mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Bug#35269 mysqlcheck behaves different depending on order of parameters
Issue an error if user specifies multiple commands to run. Also there was an unnoticed bug that DO_CHECK was actually 0 which lead to wrong actions in some cases. The mysqlcheck.test contained commands with the suspicious meaning for the above reason. Extra commands removed from there. per-file commands: client/mysqlcheck.c Bug#35269 mysqlcheck behaves different depending on order of parameters Drop with an error if multiple commands. mysql-test/r/mysqlcheck.result Bug#35269 mysqlcheck behaves different depending on order of parameters result completed. mysql-test/t/mysqlcheck.test Bug#35269 mysqlcheck behaves different depending on order of parameters testcase added. not-working commands removed from some mysqlcheck calls.
This commit is contained in:
@ -47,7 +47,7 @@ static char *shared_memory_base_name=0;
|
||||
#endif
|
||||
static uint opt_protocol=0;
|
||||
|
||||
enum operations { DO_CHECK, DO_REPAIR, DO_ANALYZE, DO_OPTIMIZE, DO_UPGRADE };
|
||||
enum operations { DO_CHECK=1, DO_REPAIR, DO_ANALYZE, DO_OPTIMIZE, DO_UPGRADE };
|
||||
|
||||
static struct my_option my_long_options[] =
|
||||
{
|
||||
@ -241,6 +241,8 @@ static my_bool
|
||||
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
char *argument)
|
||||
{
|
||||
int orig_what_to_do= what_to_do;
|
||||
|
||||
switch(optid) {
|
||||
case 'a':
|
||||
what_to_do = DO_ANALYZE;
|
||||
@ -315,6 +317,13 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
opt->name);
|
||||
break;
|
||||
}
|
||||
|
||||
if (orig_what_to_do && (what_to_do != orig_what_to_do))
|
||||
{
|
||||
fprintf(stderr, "Error: %s doesn't support multiple contradicting commands.\n",
|
||||
my_progname);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user