Bug #89323 mysql_upgrade error message could be more verbose
Submitted: 19 Jan 2018 14:10 Modified: 23 Jan 2018 12:04
Reporter: Oli Sennhauser Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.7.21 OS:Linux (n.a.)
Assigned to: CPU Architecture:Any
Tags: error, mysql_upgrade, table name

[19 Jan 2018 14:10] Oli Sennhauser
Description:
We upgraded from 5.7.12 to 5.7.21 today and run into following error:

bash> mysql_upgrade --user=root
Checking if update is needed.
Checking server version.
Running queries to upgrade MySQL server.
mysql_upgrade: [ERROR] 1072: Key column 'Id' doesn't exist in table

This output was not very helpful. I would have saved us a lot of time and some stress when the table name would have been displayed.

We found out with strace which table caused the problem:

sendto(3, "\27\1\0\0\3ALTER TABLE slave_worker_in"..., 283, 0, NULL, 0) = 283
recvfrom(3, "/\0\0\1\3770\4#42000Key column 'Id' doe"..., 16384, 0, NULL, NULL) = 51

How to repeat:
Upgrade 5.7.12 (or even older?) to 5.7.21

Suggested fix:
new error message:
mysql_upgrade: [ERROR] 1072: Key column 'Id' doesn't exist in table mysql.slave_worker_info

Basically also the mysql_upgrade utility seems to be broken... but somebody else can care about the bug report...
[19 Jan 2018 20:56] Valeriy Kravchuk
You already hit and reported this as https://bugs.mysql.com/bug.php?id=83982 ...
[19 Jan 2018 20:57] Valeriy Kravchuk
See also https://bugs.mysql.com/bug.php?id=86462 ("Verified").
[20 Jan 2018 16:52] MySQL Verification Team
i'm sure it's just reporting the server side error message. are you requesting the server side error message be changed?
[22 Jan 2018 9:26] Oli Sennhauser
Yes, Shane. As mentioned in the "suggested fix" section a more clear error message is my primary wish.

My secondary wish is, that the mysql_upgrade tool can handle very old (pre GA?) DD table structures...
[23 Jan 2018 12:04] MySQL Verification Team
Hello Oli,

Thank you for the report.
Since we already have a Bug #86462 to improve handling of upgrade errors, lets mark this as duplicate of Bug #86462 for now.

Regards,
Umesh