diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2023-03-31 21:32:41 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2023-03-31 21:32:41 +0200 |
commit | ac5a534a4caa6c86762e721dfe7183be2fee29ca (patch) | |
tree | a3d40e82beeef165e5965aec282a458b1febf23a /client/mysql_upgrade.c | |
parent | e093e5abbed1a7883b8a78935c11505bd0bcb0d6 (diff) | |
parent | eaebe8b5600b144c51a9405de42a70bd4b710987 (diff) | |
download | mariadb-git-ac5a534a4caa6c86762e721dfe7183be2fee29ca.tar.gz |
Merge remote-tracking branch '10.4' into 10.5
Diffstat (limited to 'client/mysql_upgrade.c')
-rw-r--r-- | client/mysql_upgrade.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index ad54b06101e..598045a013b 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -76,6 +76,8 @@ char upgrade_from_version[sizeof("10.20.456-MariaDB")+30]; static my_bool opt_write_binlog; +static void print_conn_args(const char *tool_name); + #define OPT_SILENT OPT_MAX_CLIENT_OPTION static struct my_option my_long_options[]= @@ -155,7 +157,10 @@ static struct my_option my_long_options[]= GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"user", 'u', "User for login.", &opt_user, &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}, {"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -210,6 +215,7 @@ static void die(const char *fmt, ...) DBUG_ENTER("die"); /* Print the error message */ + print_conn_args("mariadb-check"); fflush(stdout); va_start(args, fmt); if (fmt) @@ -640,6 +646,7 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res, "--database=mysql", "--batch", /* Turns off pager etc. */ force ? "--force": "--skip-force", + opt_verbose >= 5 ? "--verbose" : "", ds_res || opt_silent ? "--silent": "", "<", query_file_path, @@ -866,8 +873,7 @@ static int upgrade_already_done(int silent) "There is no need to run mysql_upgrade again for %s.", upgrade_from_version, version); if (!opt_check_upgrade) - verbose("You can use --force if you still want to run mysql_upgrade", - upgrade_from_version, version); + verbose("You can use --force if you still want to run mysql_upgrade"); } return 0; } @@ -1329,9 +1335,7 @@ static int run_sql_fix_privilege_tables(void) dynstr_append(&ds_script, *query_ptr); } - run_query(ds_script.str, - &ds_result, /* Collect result */ - TRUE); + run_query(ds_script.str, (opt_verbose >= 5) ? NULL : &ds_result, TRUE); { /* @@ -1502,6 +1506,7 @@ int main(int argc, char **argv) DBUG_ASSERT(phase == phases_total); end: + print_conn_args("mariadb-check"); free_used_memory(); my_end(my_end_arg); exit(0); |