Description:
When upgrading a mysql server several tasks are needed. one of those is to run mysql_upgrade.
However, there's no information directly inside the database which indicates if this has been run, when and which version of mysql_upgrade was used.
I know there is information in rpms that's tries to store this information but it seems better to record attempts to run mysql upgrade in a mysql table simply as reference information. This makes tracking failures or unexpected behaviour easier, especially in an environment where servers are being cloned heavily.
How to repeat:
Look inside the database for information regarding any changes due to upgrades and you'll see nothing.
Suggested fix:
Please add a log table which records:
- a timestamp of when the mysql_upgrade action took place
- the hostname of the server being upgraded (mysql_upgrade will need to provide this information)
- the @@hostname as this is static once the server has been started and may not match the hostname
- the mysql_upgrade version that was run
- the status of the upgrade which could be succeeded, forced, no change, ....
- perhaps a counter of the number of tables checked
- an indication of different flags used like --upgrade-system-tables or --write-binlog
Whether mysql_upgrade wants to use this information or not is up to you, but I'd like to see this history as it can be helpful diagnosing issues, and we have instances which used to run MySQL versions prior to 5.0 and having some of that upgrade history available especially when switching major versions would indeed be rather useful. I don't expect storage of this to be very large as there's only ever likely to be a couple of rows per major version.