MDEV-24453 Added support for a 5th --verbose parameter in mariadb-upgrade to show mysql results for mysql_fix_privilege_tables
This commit is contained in:
parent
f33fc2fae5
commit
d575b07c86
@ -75,6 +75,8 @@ char upgrade_from_version[sizeof("10.20.456-MariaDB")+30];
|
|||||||
|
|
||||||
static my_bool opt_write_binlog;
|
static my_bool opt_write_binlog;
|
||||||
|
|
||||||
|
static void print_conn_args(const char *tool_name);
|
||||||
|
|
||||||
#define OPT_SILENT OPT_MAX_CLIENT_OPTION
|
#define OPT_SILENT OPT_MAX_CLIENT_OPTION
|
||||||
|
|
||||||
static struct my_option my_long_options[]=
|
static struct my_option my_long_options[]=
|
||||||
@ -154,7 +156,10 @@ static struct my_option my_long_options[]=
|
|||||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"user", 'u', "User for login.", &opt_user,
|
{"user", 'u', "User for login.", &opt_user,
|
||||||
&opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
&opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"verbose", 'v', "Display more output about the process; Using it twice will print connection argument; Using it 3 times will print out all CHECK, RENAME and ALTER TABLE during the check phase.",
|
{"verbose", 'v', "Display more output about the process; Using it twice will print connection argument;"
|
||||||
|
"Using it 3 times will print out all CHECK, RENAME and ALTER TABLE during the check phase;"
|
||||||
|
"Using it 4 times (added in MariaDB 10.0.14) will also write out all mariadb-check commands used;"
|
||||||
|
"Using it 5 times will print all the mariadb commands used and their results while running mysql_fix_privilege_tables script.",
|
||||||
&opt_not_used, &opt_not_used, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
|
&opt_not_used, &opt_not_used, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
|
||||||
{"version", 'V', "Output version information and exit.", 0, 0, 0,
|
{"version", 'V', "Output version information and exit.", 0, 0, 0,
|
||||||
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
@ -208,6 +213,7 @@ static void die(const char *fmt, ...)
|
|||||||
DBUG_ENTER("die");
|
DBUG_ENTER("die");
|
||||||
|
|
||||||
/* Print the error message */
|
/* Print the error message */
|
||||||
|
print_conn_args("mariadb-check");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
if (fmt)
|
if (fmt)
|
||||||
@ -622,6 +628,7 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res,
|
|||||||
"--database=mysql",
|
"--database=mysql",
|
||||||
"--batch", /* Turns off pager etc. */
|
"--batch", /* Turns off pager etc. */
|
||||||
force ? "--force": "--skip-force",
|
force ? "--force": "--skip-force",
|
||||||
|
opt_verbose >= 5 ? "--verbose" : "",
|
||||||
ds_res || opt_silent ? "--silent": "",
|
ds_res || opt_silent ? "--silent": "",
|
||||||
"<",
|
"<",
|
||||||
query_file_path,
|
query_file_path,
|
||||||
@ -1243,9 +1250,7 @@ static int run_sql_fix_privilege_tables(void)
|
|||||||
dynstr_append(&ds_script, *query_ptr);
|
dynstr_append(&ds_script, *query_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
run_query(ds_script.str,
|
run_query(ds_script.str, (opt_verbose >= 5) ? NULL : &ds_result, TRUE);
|
||||||
&ds_result, /* Collect result */
|
|
||||||
TRUE);
|
|
||||||
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@ -1413,6 +1418,7 @@ int main(int argc, char **argv)
|
|||||||
DBUG_ASSERT(phase == phases_total);
|
DBUG_ASSERT(phase == phases_total);
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
print_conn_args("mariadb-check");
|
||||||
free_used_memory();
|
free_used_memory();
|
||||||
my_end(my_end_arg);
|
my_end(my_end_arg);
|
||||||
exit(0);
|
exit(0);
|
||||||
|
@ -656,7 +656,8 @@ The MariaDB user name to use when connecting to the server and not using the cur
|
|||||||
Display more output about the process\&. Using it twice will print connection
|
Display more output about the process\&. Using it twice will print connection
|
||||||
arguments; using it 3 times will print out all CHECK, RENAME and ALTER TABLE
|
arguments; using it 3 times will print out all CHECK, RENAME and ALTER TABLE
|
||||||
commands used during the check phase; using it 4 times (added in MariaDB 10.0.14)
|
commands used during the check phase; using it 4 times (added in MariaDB 10.0.14)
|
||||||
will also write out all mysqlcheck commands used\&.
|
will also write out all mariadb-check commands used; using it 5 times will print all
|
||||||
|
the mariadb commands used and their results while running mysql_fix_privilege_tables script\&.
|
||||||
.RE
|
.RE
|
||||||
.sp
|
.sp
|
||||||
.RS 4
|
.RS 4
|
||||||
|
Loading…
x
Reference in New Issue
Block a user