Bug #68163 | ordering of mysql_upgrade tasks is not optimal (makes upgrades noisy) | ||
---|---|---|---|
Submitted: | 24 Jan 2013 12:54 | Modified: | 13 Mar 2013 13:24 |
Reporter: | Simon Mudd (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Installing | Severity: | S3 (Non-critical) |
Version: | 5.6.9rc | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[24 Jan 2013 12:54]
Simon Mudd
[24 Jan 2013 13:03]
Mark Leith
Verified with code inspection, and should be relatively easy to fix (not counting tests that may be done on this already), we currently do: /* Run "mysqlcheck" and "mysql_fix_privilege_tables.sql" */ if ((!opt_systables_only && (run_mysqlcheck_fixnames() || run_mysqlcheck_upgrade())) || 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" ); } We should just change the if logic around a little to upgrade the system tables first: if (run_sql_fix_privilege_tables() || (!opt_systables_only && (run_mysqlcheck_fixnames() || run_mysqlcheck_upgrade())))
[13 Mar 2013 13:24]
Erlend Dahl
Noted in 5.6.11, 5.7.1 changelogs. mysqlcheck has a new --skip-database option. The option value is the name of a database (case sensitive) for which checks should be skipped. mysql_upgrade uses this option to upgrade the system tables in the mysql database before tables in other databases: It upgrades the mysql database, then all databases except the mysql database. This avoids problems that can occur if user tables are upgraded before the system tables.
[17 Feb 2016 19:42]
Paul DuBois
Revision to changelog entry (to avoid the impression that mysql_upgrade itself accepts the --skip-database option): mysql_upgrade adds this option to mysqlcheck commands that it generates to upgrade the system tables in the mysql database before tables in other databases: It upgrades the mysql database, then all databases except the mysql database. This avoids problems that can occur if user tables are upgraded before the system tables.