Commit 25872e28 authored by Daniel Black's avatar Daniel Black

Correct phase count on mysql_upgrade

Add static vars on phases to make merging consistent.

client/mysql_upgrade --verbose -S /tmp/s.sock
Looking for 'mysql' as: client/mysql
Looking for 'mysqlcheck' as: client/mysqlcheck
Phase 1/4: Fixing views - skipped - not required
Phase 2/4: Fixing table and database names
Processing databases
information_schema
mysql
performance_schema
test
Phase 3/4: Checking and upgrading tables
Processing databases
information_schema
mysql
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.event                                        OK
mysql.func                                         OK
mysql.help_category                                OK
mysql.help_keyword                                 OK
mysql.help_relation                                OK
mysql.help_topic                                   OK
mysql.host                                         OK
mysql.ndb_binlog_index                             OK
mysql.plugin                                       OK
mysql.proc                                         OK
mysql.procs_priv                                   OK
mysql.proxies_priv                                 OK
mysql.servers                                      OK
mysql.tables_priv                                  OK
mysql.time_zone                                    OK
mysql.time_zone_leap_second                        OK
mysql.time_zone_name                               OK
mysql.time_zone_transition                         OK
mysql.time_zone_transition_type                    OK
mysql.user                                         OK
performance_schema
test
Phase 4/4: Running 'mysql_fix_privilege_tables'...
OK
parent ebd3c6cc
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
# endif # endif
#endif #endif
static int phase = 1;
static int phases_total = 4;
static char mysql_path[FN_REFLEN]; static char mysql_path[FN_REFLEN];
static char mysqlcheck_path[FN_REFLEN]; static char mysqlcheck_path[FN_REFLEN];
...@@ -738,7 +740,7 @@ static void print_conn_args(const char *tool_name) ...@@ -738,7 +740,7 @@ static void print_conn_args(const char *tool_name)
static int run_mysqlcheck_upgrade(void) static int run_mysqlcheck_upgrade(void)
{ {
verbose("Phase 2/3: Checking and upgrading tables"); verbose("Phase %d/%d: Checking and upgrading tables", phase++, phases_total);
print_conn_args("mysqlcheck"); print_conn_args("mysqlcheck");
return run_tool(mysqlcheck_path, return run_tool(mysqlcheck_path,
NULL, /* Send output from mysqlcheck directly to screen */ NULL, /* Send output from mysqlcheck directly to screen */
...@@ -779,8 +781,11 @@ static my_bool is_mysql() ...@@ -779,8 +781,11 @@ static my_bool is_mysql()
static int run_mysqlcheck_views(void) static int run_mysqlcheck_views(void)
{ {
if (!is_mysql()) if (!is_mysql())
{
verbose("Phase %d/%d: Fixing views - skipped - not required", phase++, phases_total);
return 0; return 0;
verbose("Phase 0: Fixing views"); }
verbose("Phase %d/%d: Fixing views", phase++, phases_total);
print_conn_args("mysqlcheck"); print_conn_args("mysqlcheck");
return run_tool(mysqlcheck_path, return run_tool(mysqlcheck_path,
NULL, /* Send output from mysqlcheck directly to screen */ NULL, /* Send output from mysqlcheck directly to screen */
...@@ -796,7 +801,7 @@ static int run_mysqlcheck_views(void) ...@@ -796,7 +801,7 @@ static int run_mysqlcheck_views(void)
static int run_mysqlcheck_fixnames(void) static int run_mysqlcheck_fixnames(void)
{ {
verbose("Phase 1/3: Fixing table and database names"); verbose("Phase %d/%d: Fixing table and database names", phase++, phases_total);
print_conn_args("mysqlcheck"); print_conn_args("mysqlcheck");
return run_tool(mysqlcheck_path, return run_tool(mysqlcheck_path,
NULL, /* Send output from mysqlcheck directly to screen */ NULL, /* Send output from mysqlcheck directly to screen */
...@@ -877,7 +882,7 @@ static int run_sql_fix_privilege_tables(void) ...@@ -877,7 +882,7 @@ static int run_sql_fix_privilege_tables(void)
if (init_dynamic_string(&ds_result, "", 512, 512)) if (init_dynamic_string(&ds_result, "", 512, 512))
die("Out of memory"); die("Out of memory");
verbose("Phase 3/3: Running 'mysql_fix_privilege_tables'..."); verbose("Phase %d/%d: Running 'mysql_fix_privilege_tables'...", phase++, phases_total);
run_query(mysql_fix_privilege_tables, run_query(mysql_fix_privilege_tables,
&ds_result, /* Collect result */ &ds_result, /* Collect result */
TRUE); TRUE);
......
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