MDEV-6535 Ordering of mysql_upgrade tasks is not optimal

first update system tables, then the rest
This commit is contained in:
Sergei Golubchik 2014-08-06 13:27:44 +02:00
parent 3390291b95
commit 15a9103c48
7 changed files with 209 additions and 120 deletions

View file

@ -206,12 +206,12 @@ static void die(const char *fmt, ...)
} }
static void verbose(const char *fmt, ...) static int verbose(const char *fmt, ...)
{ {
va_list args; va_list args;
if (opt_silent) if (opt_silent)
return; return 0;
/* Print the verbose message */ /* Print the verbose message */
va_start(args, fmt); va_start(args, fmt);
@ -222,6 +222,7 @@ static void verbose(const char *fmt, ...)
fflush(stdout); fflush(stdout);
} }
va_end(args); va_end(args);
return 0;
} }
@ -736,20 +737,19 @@ static void print_conn_args(const char *tool_name)
in the server using "mysqlcheck --check-upgrade .." in the server using "mysqlcheck --check-upgrade .."
*/ */
static int run_mysqlcheck_upgrade(void) static int run_mysqlcheck_upgrade(const char *arg1, const char *arg2)
{ {
verbose("Phase 2/3: Checking and upgrading tables");
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 */
"--no-defaults", "--no-defaults",
ds_args.str, ds_args.str,
"--check-upgrade", "--check-upgrade",
"--all-databases",
"--auto-repair", "--auto-repair",
!opt_silent || opt_verbose ? "--verbose": "", !opt_silent || opt_verbose ? "--verbose": "",
opt_silent ? "--silent": "", opt_silent ? "--silent": "",
opt_write_binlog ? "--write-binlog" : "--skip-write-binlog", opt_write_binlog ? "--write-binlog" : "--skip-write-binlog",
arg1, arg2,
"2>&1", "2>&1",
NULL); NULL);
} }
@ -757,7 +757,7 @@ static int run_mysqlcheck_upgrade(void)
static int run_mysqlcheck_fixnames(void) static int run_mysqlcheck_fixnames(void)
{ {
verbose("Phase 1/3: Fixing table and database names"); verbose("Phase 2/3: Fixing table and database names");
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 */
@ -843,7 +843,6 @@ 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'...");
/* /*
Individual queries can not be executed independently by invoking Individual queries can not be executed independently by invoking
a forked mysql client, because the script uses session variables a forked mysql client, because the script uses session variables
@ -990,16 +989,12 @@ int main(int argc, char **argv)
/* Find mysql */ /* Find mysql */
find_tool(mysql_path, IF_WIN("mysql.exe", "mysql"), self_name); find_tool(mysql_path, IF_WIN("mysql.exe", "mysql"), self_name);
if (!opt_systables_only) /* Find mysqlcheck */
{ find_tool(mysqlcheck_path, IF_WIN("mysqlcheck.exe", "mysqlcheck"), self_name);
/* Find mysqlcheck */
find_tool(mysqlcheck_path, IF_WIN("mysqlcheck.exe", "mysqlcheck"), self_name); if (opt_systables_only && !opt_silent)
} printf("The --upgrade-system-tables option was used, user tables won't be touched.\n");
else
{
if (!opt_silent)
printf("The --upgrade-system-tables option was used, databases won't be touched.\n");
}
/* /*
Read the mysql_upgrade_info file to check if mysql_upgrade Read the mysql_upgrade_info file to check if mysql_upgrade
@ -1019,16 +1014,16 @@ int main(int argc, char **argv)
/* /*
Run "mysqlcheck" and "mysql_fix_privilege_tables.sql" Run "mysqlcheck" and "mysql_fix_privilege_tables.sql"
*/ */
if ((!opt_systables_only && verbose("Phase 1/3: Running 'mysql_fix_privilege_tables'...");
(run_mysqlcheck_fixnames() || run_mysqlcheck_upgrade())) || if (run_mysqlcheck_upgrade("--databases", "mysql") ||
run_sql_fix_privilege_tables()) run_sql_fix_privilege_tables())
{
/*
The upgrade failed to complete in some way or another,
significant error message should have been printed to the screen
*/
die("Upgrade failed" ); die("Upgrade failed" );
} if (!opt_systables_only &&
(run_mysqlcheck_fixnames() ||
verbose("Phase 3/3: Checking and upgrading tables") ||
run_mysqlcheck_upgrade("--all-databases","--skip-database=mysql")))
die("Upgrade failed" );
verbose("OK"); verbose("OK");
/* Create a file indicating upgrade has been performed */ /* Create a file indicating upgrade has been performed */

View file

@ -51,6 +51,7 @@ static char *opt_password = 0, *current_user = 0,
*default_charset= 0, *current_host= 0; *default_charset= 0, *current_host= 0;
static char *opt_plugin_dir= 0, *opt_default_auth= 0; static char *opt_plugin_dir= 0, *opt_default_auth= 0;
static int first_error = 0; static int first_error = 0;
static char *opt_skip_database;
DYNAMIC_ARRAY tables4repair, tables4rebuild, alter_table_cmds; DYNAMIC_ARRAY tables4repair, tables4rebuild, alter_table_cmds;
static char *shared_memory_base_name=0; static char *shared_memory_base_name=0;
static uint opt_protocol=0; static uint opt_protocol=0;
@ -178,6 +179,9 @@ static struct my_option my_long_options[] =
#endif #endif
{"silent", 's', "Print only error messages.", &opt_silent, {"silent", 's', "Print only error messages.", &opt_silent,
&opt_silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, &opt_silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"skip_database", 0, "Don't process the database specified as argument",
&opt_skip_database, &opt_skip_database, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"socket", 'S', "The socket file to use for connection.", {"socket", 'S', "The socket file to use for connection.",
&opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR, &opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@ -246,6 +250,9 @@ static void usage(void)
puts("mysqlrepair: The default option will be -r"); puts("mysqlrepair: The default option will be -r");
puts("mysqlanalyze: The default option will be -a"); puts("mysqlanalyze: The default option will be -a");
puts("mysqloptimize: The default option will be -o\n"); puts("mysqloptimize: The default option will be -o\n");
printf("Usage: %s [OPTIONS] database [tables]\n", my_progname);
printf("OR %s [OPTIONS] --databases DB1 [DB2 DB3...]\n",
my_progname);
puts("Please consult the MariaDB/MySQL knowledgebase at"); puts("Please consult the MariaDB/MySQL knowledgebase at");
puts("http://kb.askmonty.org/v/mysqlcheck for latest information about"); puts("http://kb.askmonty.org/v/mysqlcheck for latest information about");
puts("this program."); puts("this program.");
@ -696,6 +703,9 @@ static int process_one_db(char *database)
{ {
DBUG_ENTER("process_one_db"); DBUG_ENTER("process_one_db");
if (opt_skip_database && !strcmp(database, opt_skip_database))
DBUG_RETURN(0);
if (verbose) if (verbose)
puts(database); puts(database);
if (what_to_do == DO_UPGRADE) if (what_to_do == DO_UPGRADE)

View file

@ -227,13 +227,8 @@ DROP TABLE mysql050614_xxx_croatian_ci;
# Checking mysql_upgrade # Checking mysql_upgrade
# #
# Running mysql_upgrade # Running mysql_upgrade
Phase 1/3: Fixing table and database names Phase 1/3: Running 'mysql_fix_privilege_tables'...
Phase 2/3: Checking and upgrading tables
Processing databases Processing databases
information_schema
mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql mysql
mysql.column_stats OK mysql.column_stats OK
mysql.columns_priv OK mysql.columns_priv OK
@ -263,6 +258,13 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK mysql.time_zone_transition OK
mysql.time_zone_transition_type OK mysql.time_zone_transition_type OK
mysql.user OK mysql.user OK
Phase 2/3: Fixing table and database names
Phase 3/3: Checking and upgrading tables
Processing databases
information_schema
mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema performance_schema
test test
test.maria050313_ucs2_croatian_ci_def Needs upgrade test.maria050313_ucs2_croatian_ci_def Needs upgrade
@ -276,17 +278,11 @@ test.maria050313_ucs2_croatian_ci_def OK
test.maria050313_utf8_croatian_ci OK test.maria050313_utf8_croatian_ci OK
test.maria050533_xxx_croatian_ci OK test.maria050533_xxx_croatian_ci OK
test.maria100004_xxx_croatian_ci OK test.maria100004_xxx_croatian_ci OK
Phase 3/3: Running 'mysql_fix_privilege_tables'...
OK OK
# Running mysql_upgrade for the second time # Running mysql_upgrade for the second time
# This should report OK for all tables # This should report OK for all tables
Phase 1/3: Fixing table and database names Phase 1/3: Running 'mysql_fix_privilege_tables'...
Phase 2/3: Checking and upgrading tables
Processing databases Processing databases
information_schema
mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql mysql
mysql.column_stats OK mysql.column_stats OK
mysql.columns_priv OK mysql.columns_priv OK
@ -316,6 +312,13 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK mysql.time_zone_transition OK
mysql.time_zone_transition_type OK mysql.time_zone_transition_type OK
mysql.user OK mysql.user OK
Phase 2/3: Fixing table and database names
Phase 3/3: Checking and upgrading tables
Processing databases
information_schema
mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema performance_schema
test test
test.maria050313_ucs2_croatian_ci_def OK test.maria050313_ucs2_croatian_ci_def OK
@ -323,7 +326,6 @@ test.maria050313_utf8_croatian_ci OK
test.maria050533_xxx_croatian_ci OK test.maria050533_xxx_croatian_ci OK
test.maria100004_xxx_croatian_ci OK test.maria100004_xxx_croatian_ci OK
test.mysql050614_xxx_croatian_ci OK test.mysql050614_xxx_croatian_ci OK
Phase 3/3: Running 'mysql_fix_privilege_tables'...
OK OK
SHOW CREATE TABLE maria050313_ucs2_croatian_ci_def; SHOW CREATE TABLE maria050313_ucs2_croatian_ci_def;
Table Create Table Table Create Table

View file

@ -11,13 +11,8 @@ Table Op Msg_type Msg_text
test.bug49823 repair status OK test.bug49823 repair status OK
RENAME TABLE general_log TO renamed_general_log; RENAME TABLE general_log TO renamed_general_log;
RENAME TABLE test.bug49823 TO general_log; RENAME TABLE test.bug49823 TO general_log;
Phase 1/3: Fixing table and database names Phase 1/3: Running 'mysql_fix_privilege_tables'...
Phase 2/3: Checking and upgrading tables
Processing databases Processing databases
information_schema
mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql mysql
mysql.column_stats OK mysql.column_stats OK
mysql.columns_priv OK mysql.columns_priv OK
@ -48,9 +43,15 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK mysql.time_zone_transition OK
mysql.time_zone_transition_type OK mysql.time_zone_transition_type OK
mysql.user OK mysql.user OK
Phase 2/3: Fixing table and database names
Phase 3/3: Checking and upgrading tables
Processing databases
information_schema
mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema performance_schema
test test
Phase 3/3: Running 'mysql_fix_privilege_tables'...
OK OK
DROP TABLE general_log; DROP TABLE general_log;
RENAME TABLE renamed_general_log TO general_log; RENAME TABLE renamed_general_log TO general_log;

View file

@ -1,11 +1,6 @@
Run mysql_upgrade once Run mysql_upgrade once
Phase 1/3: Fixing table and database names Phase 1/3: Running 'mysql_fix_privilege_tables'...
Phase 2/3: Checking and upgrading tables
Processing databases Processing databases
information_schema
mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql mysql
mysql.column_stats OK mysql.column_stats OK
mysql.columns_priv OK mysql.columns_priv OK
@ -35,20 +30,21 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK mysql.time_zone_transition OK
mysql.time_zone_transition_type OK mysql.time_zone_transition_type OK
mysql.user OK mysql.user OK
Phase 2/3: Fixing table and database names
Phase 3/3: Checking and upgrading tables
Processing databases
information_schema
mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema performance_schema
test test
Phase 3/3: Running 'mysql_fix_privilege_tables'...
OK OK
Run it again - should say already completed Run it again - should say already completed
This installation of MySQL is already upgraded to VERSION, use --force if you still need to run mysql_upgrade This installation of MySQL is already upgraded to VERSION, use --force if you still need to run mysql_upgrade
Force should run it regardless of wether it's been run before Force should run it regardless of wether it's been run before
Phase 1/3: Fixing table and database names Phase 1/3: Running 'mysql_fix_privilege_tables'...
Phase 2/3: Checking and upgrading tables
Processing databases Processing databases
information_schema
mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql mysql
mysql.column_stats OK mysql.column_stats OK
mysql.columns_priv OK mysql.columns_priv OK
@ -78,20 +74,21 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK mysql.time_zone_transition OK
mysql.time_zone_transition_type OK mysql.time_zone_transition_type OK
mysql.user OK mysql.user OK
Phase 2/3: Fixing table and database names
Phase 3/3: Checking and upgrading tables
Processing databases
information_schema
mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema performance_schema
test test
Phase 3/3: Running 'mysql_fix_privilege_tables'...
OK OK
CREATE USER mysqltest1@'%' IDENTIFIED by 'sakila'; CREATE USER mysqltest1@'%' IDENTIFIED by 'sakila';
GRANT ALL ON *.* TO mysqltest1@'%'; GRANT ALL ON *.* TO mysqltest1@'%';
Run mysql_upgrade with password protected account Run mysql_upgrade with password protected account
Phase 1/3: Fixing table and database names Phase 1/3: Running 'mysql_fix_privilege_tables'...
Phase 2/3: Checking and upgrading tables
Processing databases Processing databases
information_schema
mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql mysql
mysql.column_stats OK mysql.column_stats OK
mysql.columns_priv OK mysql.columns_priv OK
@ -121,9 +118,15 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK mysql.time_zone_transition OK
mysql.time_zone_transition_type OK mysql.time_zone_transition_type OK
mysql.user OK mysql.user OK
Phase 2/3: Fixing table and database names
Phase 3/3: Checking and upgrading tables
Processing databases
information_schema
mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema performance_schema
test test
Phase 3/3: Running 'mysql_fix_privilege_tables'...
OK OK
DROP USER mysqltest1@'%'; DROP USER mysqltest1@'%';
Version check failed. Got the following error when calling the 'mysql' command line client Version check failed. Got the following error when calling the 'mysql' command line client
@ -133,13 +136,8 @@ Run mysql_upgrade with a non existing server socket
mysqlcheck: Got error: 2005: Unknown MySQL server host 'not_existing_host' (errno) when trying to connect mysqlcheck: Got error: 2005: Unknown MySQL server host 'not_existing_host' (errno) when trying to connect
FATAL ERROR: Upgrade failed FATAL ERROR: Upgrade failed
set GLOBAL sql_mode='STRICT_ALL_TABLES,ANSI_QUOTES,NO_ZERO_DATE'; set GLOBAL sql_mode='STRICT_ALL_TABLES,ANSI_QUOTES,NO_ZERO_DATE';
Phase 1/3: Fixing table and database names Phase 1/3: Running 'mysql_fix_privilege_tables'...
Phase 2/3: Checking and upgrading tables
Processing databases Processing databases
information_schema
mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql mysql
mysql.column_stats OK mysql.column_stats OK
mysql.columns_priv OK mysql.columns_priv OK
@ -169,9 +167,15 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK mysql.time_zone_transition OK
mysql.time_zone_transition_type OK mysql.time_zone_transition_type OK
mysql.user OK mysql.user OK
Phase 2/3: Fixing table and database names
Phase 3/3: Checking and upgrading tables
Processing databases
information_schema
mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema performance_schema
test test
Phase 3/3: Running 'mysql_fix_privilege_tables'...
OK OK
set GLOBAL sql_mode=default; set GLOBAL sql_mode=default;
# #
@ -182,13 +186,8 @@ CREATE PROCEDURE testproc() BEGIN END;
UPDATE mysql.proc SET character_set_client = NULL WHERE name LIKE 'testproc'; UPDATE mysql.proc SET character_set_client = NULL WHERE name LIKE 'testproc';
UPDATE mysql.proc SET collation_connection = NULL WHERE name LIKE 'testproc'; UPDATE mysql.proc SET collation_connection = NULL WHERE name LIKE 'testproc';
UPDATE mysql.proc SET db_collation = NULL WHERE name LIKE 'testproc'; UPDATE mysql.proc SET db_collation = NULL WHERE name LIKE 'testproc';
Phase 1/3: Fixing table and database names Phase 1/3: Running 'mysql_fix_privilege_tables'...
Phase 2/3: Checking and upgrading tables
Processing databases Processing databases
information_schema
mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql mysql
mysql.column_stats OK mysql.column_stats OK
mysql.columns_priv OK mysql.columns_priv OK
@ -218,9 +217,15 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK mysql.time_zone_transition OK
mysql.time_zone_transition_type OK mysql.time_zone_transition_type OK
mysql.user OK mysql.user OK
Phase 2/3: Fixing table and database names
Phase 3/3: Checking and upgrading tables
Processing databases
information_schema
mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema performance_schema
test test
Phase 3/3: Running 'mysql_fix_privilege_tables'...
OK OK
CALL testproc(); CALL testproc();
DROP PROCEDURE testproc; DROP PROCEDURE testproc;
@ -234,13 +239,8 @@ WARNING: NULL values of the 'db_collation' column ('mysql.proc' table) have been
GRANT USAGE ON *.* TO 'user3'@'%'; GRANT USAGE ON *.* TO 'user3'@'%';
GRANT ALL PRIVILEGES ON `roelt`.`test2` TO 'user3'@'%'; GRANT ALL PRIVILEGES ON `roelt`.`test2` TO 'user3'@'%';
Run mysql_upgrade with all privileges on a user Run mysql_upgrade with all privileges on a user
Phase 1/3: Fixing table and database names Phase 1/3: Running 'mysql_fix_privilege_tables'...
Phase 2/3: Checking and upgrading tables
Processing databases Processing databases
information_schema
mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql mysql
mysql.column_stats OK mysql.column_stats OK
mysql.columns_priv OK mysql.columns_priv OK
@ -270,9 +270,15 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK mysql.time_zone_transition OK
mysql.time_zone_transition_type OK mysql.time_zone_transition_type OK
mysql.user OK mysql.user OK
Phase 2/3: Fixing table and database names
Phase 3/3: Checking and upgrading tables
Processing databases
information_schema
mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema performance_schema
test test
Phase 3/3: Running 'mysql_fix_privilege_tables'...
OK OK
SHOW GRANTS FOR 'user3'@'%'; SHOW GRANTS FOR 'user3'@'%';
Grants for user3@% Grants for user3@%
@ -280,22 +286,9 @@ GRANT USAGE ON *.* TO 'user3'@'%'
GRANT ALL PRIVILEGES ON `roelt`.`test2` TO 'user3'@'%' GRANT ALL PRIVILEGES ON `roelt`.`test2` TO 'user3'@'%'
DROP USER 'user3'@'%'; DROP USER 'user3'@'%';
End of 5.1 tests End of 5.1 tests
The --upgrade-system-tables option was used, databases won't be touched. The --upgrade-system-tables option was used, user tables won't be touched.
Phase 3/3: Running 'mysql_fix_privilege_tables'... Phase 1/3: Running 'mysql_fix_privilege_tables'...
OK
#
# Bug#11827359 60223: MYSQL_UPGRADE PROBLEM WITH OPTION
# SKIP-WRITE-BINLOG
#
# Droping the previously created mysql_upgrade_info file..
# Running mysql_upgrade with --skip-write-binlog..
Phase 1/3: Fixing table and database names
Phase 2/3: Checking and upgrading tables
Processing databases Processing databases
information_schema
mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql mysql
mysql.column_stats OK mysql.column_stats OK
mysql.columns_priv OK mysql.columns_priv OK
@ -325,9 +318,53 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK mysql.time_zone_transition OK
mysql.time_zone_transition_type OK mysql.time_zone_transition_type OK
mysql.user OK mysql.user OK
OK
#
# Bug#11827359 60223: MYSQL_UPGRADE PROBLEM WITH OPTION
# SKIP-WRITE-BINLOG
#
# Droping the previously created mysql_upgrade_info file..
# Running mysql_upgrade with --skip-write-binlog..
Phase 1/3: Running 'mysql_fix_privilege_tables'...
Processing databases
mysql
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
mysql.gtid_slave_pos OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.index_stats OK
mysql.innodb_index_stats OK
mysql.innodb_table_stats OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.roles_mapping OK
mysql.servers OK
mysql.table_stats 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
Phase 2/3: Fixing table and database names
Phase 3/3: Checking and upgrading tables
Processing databases
information_schema
mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema performance_schema
test test
Phase 3/3: Running 'mysql_fix_privilege_tables'...
OK OK
# #
# MDEV-4332 Increase username length from 16 characters # MDEV-4332 Increase username length from 16 characters
@ -341,13 +378,8 @@ GRANT INSERT ON mysql.user TO very_long_user_name_number_2;
GRANT UPDATE (User) ON mysql.db TO very_long_user_name_number_1; GRANT UPDATE (User) ON mysql.db TO very_long_user_name_number_1;
GRANT UPDATE (User) ON mysql.db TO very_long_user_name_number_2; GRANT UPDATE (User) ON mysql.db TO very_long_user_name_number_2;
CREATE PROCEDURE test.pr() BEGIN END; CREATE PROCEDURE test.pr() BEGIN END;
Phase 1/3: Fixing table and database names Phase 1/3: Running 'mysql_fix_privilege_tables'...
Phase 2/3: Checking and upgrading tables
Processing databases Processing databases
information_schema
mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql mysql
mysql.column_stats OK mysql.column_stats OK
mysql.columns_priv OK mysql.columns_priv OK
@ -377,9 +409,15 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK mysql.time_zone_transition OK
mysql.time_zone_transition_type OK mysql.time_zone_transition_type OK
mysql.user OK mysql.user OK
Phase 2/3: Fixing table and database names
Phase 3/3: Checking and upgrading tables
Processing databases
information_schema
mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema performance_schema
test test
Phase 3/3: Running 'mysql_fix_privilege_tables'...
OK OK
SELECT definer FROM mysql.proc WHERE db = 'test' AND name = 'pr'; SELECT definer FROM mysql.proc WHERE db = 'test' AND name = 'pr';
definer definer

View file

@ -1,3 +1,45 @@
The --upgrade-system-tables option was used, databases won't be touched. The --upgrade-system-tables option was used, user tables won't be touched.
Phase 3/3: Running 'mysql_fix_privilege_tables'... Phase 1/3: Running 'mysql_fix_privilege_tables'...
Processing databases
mysql
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
mysql.gtid_slave_pos OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.index_stats OK
mysql.innodb_index_stats
Error : Unknown storage engine 'InnoDB'
error : Corrupt
mysql.innodb_table_stats
Error : Unknown storage engine 'InnoDB'
error : Corrupt
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.roles_mapping OK
mysql.servers OK
mysql.table_stats 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
Repairing tables
mysql.innodb_index_stats
Error : Unknown storage engine 'InnoDB'
error : Corrupt
mysql.innodb_table_stats
Error : Unknown storage engine 'InnoDB'
error : Corrupt
OK OK

View file

@ -1,13 +1,8 @@
# #
# Bug#55672 mysql_upgrade dies with internal error # Bug#55672 mysql_upgrade dies with internal error
# #
Phase 1/3: Fixing table and database names Phase 1/3: Running 'mysql_fix_privilege_tables'...
Phase 2/3: Checking and upgrading tables
Processing databases Processing databases
information_schema
mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql mysql
mysql.column_stats OK mysql.column_stats OK
mysql.columns_priv OK mysql.columns_priv OK
@ -37,7 +32,13 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK mysql.time_zone_transition OK
mysql.time_zone_transition_type OK mysql.time_zone_transition_type OK
mysql.user OK mysql.user OK
Phase 2/3: Fixing table and database names
Phase 3/3: Checking and upgrading tables
Processing databases
information_schema
mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema performance_schema
test test
Phase 3/3: Running 'mysql_fix_privilege_tables'...
OK OK