Bug #52444 mysql_upgrade fails b/w 5.1 -> 5.5 (Celosia)
Submitted: 29 Mar 2010 15:42 Modified: 8 May 2010 22:11
Reporter: Nidhi Shrotriya Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S3 (Non-critical)
Version:5.5.3-m3 OS:Any
Assigned to: Alexander Nozdrin CPU Architecture:Any

[29 Mar 2010 15:42] Nidhi Shrotriya
Description:
Running mysql_upgrade on 5.5.3-m3 after doing dump/live upgrade of server from  5.1 fails with below error-

Running 'mysql_fix_privilege_tables'...
ERROR 1548 (HY000) at line 167: Cannot load from mysql.proc. The table is probably corrupted
ERROR 1548 (HY000) at line 168: Cannot load from mysql.proc. The table is probably corrupted
ERROR 1548 (HY000) at line 181: Cannot load from mysql.proc. The table is probably corrupted
FATAL ERROR: Upgrade failed

Could be related to fix for http://bugs.mysql.com/bug.php?id=42589. Not sure if this is pushed to 5.5.3-m3 ?

How to repeat:
5.1.45 server. 
scripts/mysql_install_db --no-defaults
Start server.
Create some data (not necessary)
stop server.

5.5.3-m3 server (picked from > bteam@astra04:~/my/build-201003122000-5.5.3-m3/mysql-5.5.3-m3-build/dist/packages/mysql-5.5.3-m3-linux2.6-x86_64.tar.gz)
Start server with the above datadir (for live upgrade) or load the dump from 5.1 data (for dump upgrade)
Run mysql_upgrade -> fails with the above error.

Need to analyse the impact yet.
[30 Mar 2010 10:46] Nidhi Shrotriya
Looks like the impact is limited to the util 'mysql_upgrade' throwing bad error, though after running mysql_upgrade, mysql.proc table is repaired and doesn't remain corrupted.
Offcourse the error need to be removed as it says "FATAL ERROR" and upgrade failed.
[8 Apr 2010 16:18] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/105237

3008 Alexander Nozdrin	2010-04-08
      A patch for Bug#52444 (mysql_upgrade fails b/w 5.1 -> 5.5 (Celosia)).
      
      The problem was that the code that works with stored routines was present
      in mysql_system_tables.sql. This is wrong because until upgrade is finished,
      stored routines may be (and were) not available.
      
      A fix is to move that code to the end of mysql_system_tables_fix.sql.
[14 Apr 2010 16:40] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/105659

3016 Alexander Nozdrin	2010-04-14
      A patch for Bug#52444 (mysql_upgrade fails b/w 5.1 -> 5.5 (Celosia)).
      
      The problem was that the code that works with stored routines was present
      in mysql_system_tables.sql. This is wrong because until upgrade is finished,
      stored routines may be (and were) not available.
      
      The fix is to move that code to the end of mysql_system_tables_fix.sql.
[14 Apr 2010 16:45] Alexander Nozdrin
Pushed into mysql-trunk-bugfixing.
[15 Apr 2010 8:12] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/105696

3017 Alexander Nozdrin	2010-04-15
      Post-fix for Bug#52444: update test result.
[20 Apr 2010 9:24] Sveta Smirnova
Bug #52972 was marked as duplicate of this one.
[27 Apr 2010 9:45] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100427094135-5s49ecp3ckson6e2) (version source revid:alik@sun.com-20100427093843-uekr85qkd7orx12t) (merge vers: 6.0.14-alpha) (pib:16)
[27 Apr 2010 9:48] Bugs System
Pushed into 5.5.5-m3 (revid:alik@sun.com-20100427093804-a2k3rrjpwu5jegu8) (version source revid:alik@sun.com-20100427093804-a2k3rrjpwu5jegu8) (merge vers: 5.5.5-m3) (pib:16)
[27 Apr 2010 9:50] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100427094036-38frbg3famdlvjup) (version source revid:alik@sun.com-20100427093825-92wc8b22d4yg34ju) (pib:16)
[8 May 2010 22:11] Paul Dubois
Noted in 5.5.5, 6.0.14 changelogs.

mysql_upgrade attempted to work with stored routines before they were
available.