Bug #50183 mysql.proc table needs repair (corrupt) after dump downgrade from 5.5 -> 5.1
Submitted: 8 Jan 2010 11:37 Modified: 24 Feb 2010 20:17
Reporter: Nidhi Shrotriya Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.5.1-m2 OS:Any
Assigned to: Paul DuBois CPU Architecture:Any

[8 Jan 2010 11:37] Nidhi Shrotriya
Description:
After 'dump' downgrade from 5.5.1-m2 -> 5.1.42 

Create procedure gives below error-
ERROR 1548 (HY000): Cannot load from mysql.proc. The table is probably corrupted

Though 'CHECK TABLE' shows up fine.

+------------+-------+----------+----------+
| Table      | Op    | Msg_type | Msg_text |
+------------+-------+----------+----------+
| mysql.proc | check | status   | OK       |
+------------+-------+----------+----------+
1 row in set (0.00 sec)

Ran 'mysql_upgrade' and then able to 'create procedure' fine. 

So the real question that needs more investigation is why does the system view the proc table as corrupted?

How to repeat:
Start 5.1.42 server.
Dump (mysqldump --all-databases)
Stop server.
Start 5.5.1-m2 server. 
Restore the 5.1 dump. 
Run mysql_upgrade
Stop server->restart.
Dump (mysqldump --all-databases)
Stop server 5.5.1-m2. 
Start 5.1.42 server.
Restore the 5.5 dump.
[9 Jan 2010 4:40] Nidhi Shrotriya
The difference seen in the mysql.proc table is
5.5
<   `comment` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
---
5.1
 >   `comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',

Probably that has caused .frm format change and the table needed repair.
Probably it (the error reporting) is also related to fix of
http://bugs.mysql.com/bug.php?id=41726

"The solution is to validate the proc system table format
     before attempts to access it are made. If the table is not
     in the format that the server expects, a message is written
     to the error log and the statement that caused the table to
     be accessed fails."
[9 Jan 2010 4:45] Nidhi Shrotriya
it seems the 'mysql_upgrade' is a workaround for customers. 
But not clear why the change was done, and if the solution is to revert the change or only to document the issue and offer the workaround.
[24 Feb 2010 20:17] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.

Added to http://dev.mysql.com/doc/refman/5.1/en/downgrading.html:

The mysql.proc.comment column definition changed between MySQL 5.1
and 5.5. After a downgrade from 5.5 to 5.1, this table is seen as
corrupt and in need of repair. To workaround this problem, execute
mysql_upgrade from the version of MySQL to which you downgraded.