Bug #38032 PATCH: padding in system tables after upgrading from 4.1 to 5.0.51b
Submitted: 11 Jul 2008 0:39 Modified: 11 Jul 2008 11:27
Reporter: Daniel Convissor Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.0.51b OS:Any (fix padding in mysql_fix_privilege_tables.sql)
Assigned to: CPU Architecture:Any
Tags: mysql_fix_privilege_tables.sql, padding, upgrade

[11 Jul 2008 0:39] Daniel Convissor
Description:
I just tested upgrading from 4.1.20 to 5.0.51b.  The database wound up with padding in the Host, Db and User columns in many of the system tables.

I added a new user just to test what was going on.

So, if I do "SELECT Host FROM db WHERE Host = 'localhost'" I get only the new user.  But if I do "SELECT Host FROM db WHERE Host LIKE 'localhost%'" all of the rows come back.

How to repeat:
* Dump 4.1 database via mysqldump > mysql.sql
* Install fresh 5.0.51b server and tables
* Import structure via mysql < mysql.sql
* Fix tables via mysql < share/mysql_fix_privilege_tables.sql
* Log in and run this query: SELECT Host FROM db WHERE Host = 'localhost'

Suggested fix:
Get the 0x00 character out of there by using this patch:
http://www.analysisandsolutions.com/mysql/mysql_fix_privilege_tables--padding.diff
[11 Jul 2008 0:41] Daniel Convissor
patch to remove 0x00 from Host, User, etc fields

Attachment: mysql_fix_privilege_tables--padding.diff (application/octet-stream, text), 2.39 KiB.

[11 Jul 2008 11:27] Susanne Ebrecht
Many thanks for reporting a bug.

This is a duplicate of bug #35658. This here is just another effect to that bug.