Bug #33053 mysql_upgrade: Does not convert all mysql db tables from utf8mb3 to utf8
Submitted: 6 Dec 2007 23:35 Modified: 14 Aug 2008 3:31
Reporter: Paul DuBois Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Installing Severity:S2 (Serious)
Version:6.0 OS:Any
Assigned to: Davi Arnaut CPU Architecture:Any

[6 Dec 2007 23:35] Paul DuBois
Description:
In 6.0.4, the 3-byte Unicode character set formerly known as utf8 is now known as utf8mb3,
so utf8 columns from tables created before 6.0.4 show up as utf8mb3.

mysql_upgrade converts some utf8mb3 tables/columns in mysql database tables to utf8, but inconsistently. These tables retain traces of utf8mb3, at either the column or table level:

event
help_category
help_keyword
help_relation
help_topic
plugin
servers
time_zone
time_zone_leap_second
time_zone_name
time_zone_transition
time_zone_transition_type

How to repeat:
Upgrade a 5.1 installation to 6.0.4 or higher. (Or copy a 5.1 data directory to a 6.0.4
installation)

Start the server and run mysql_upgrade.

Run mysqldump --no-data mysql and grep the result for "utf8mb3"
[7 Dec 2007 16:40] Paul DuBois
Raising severity to S2.

I should note that this is an upgrade INCOMPATIBILITY. Because the event table is not converted properly, the effect for anyone upgrading to 6.0.4 is that events do not work. (The event scheduler gets disabled, per Bug#33002, and cannot be made to work by running mysql_upgrade.)
[8 Dec 2007 17:45] MySQL Verification Team
Thank you for the bug report.
[30 Apr 2008 6:22] Valeriy Kravchuk
Bug #36417 was marked as a duplicate of this one.
[5 Aug 2008 21:36] 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/50963

2745 Davi Arnaut	2008-08-05
      Bug#33053: mysql_upgrade: Does not convert all mysql db tables from utf8mb3 to utf8
      Bug#33002: Event Scheduler: Unnecessarily disabled after 5.1 -> 6.0.4 upgrade
      
      The 3-byte Unicode character set formerly known as utf8 is
      now known in 6.0 as utf8mb3 and this cause problems if system
      tables created in older versions of MySQL are used as the code
      that check table compatibility won't accept a different charset
      and this was happening for the event table that wasn't being
      properly upgraded.
      
      The solution is to ensure that all system tables are upgraded
      to use the new utf8 character set rather than the old utf8mb3.
      In the future it would be nice if the server could be capable of
      handling the character set mishap, but for now we just upgrade
      the table as the event subsystem is the only one that checks
      if a table is compatible.
[6 Aug 2008 13:25] Patrick Crews
Ok to push.
[6 Aug 2008 13:31] 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/51001

2745 Davi Arnaut	2008-08-05
      Bug#33053: mysql_upgrade: Does not convert all mysql db tables from utf8mb3 to utf8
      Bug#33002: Event Scheduler: Unnecessarily disabled after 5.1 -> 6.0.4 upgrade
      
      The 3-byte Unicode character set formerly known as utf8 is
      now known in 6.0 as utf8mb3 and this cause problems if system
      tables created in older versions of MySQL are used as the code
      that check table compatibility won't accept a different charset
      and this was happening for the event table that wasn't being
      properly upgraded.
      
      The solution is to ensure that all system tables are upgraded
      to use the new utf8 character set rather than the old utf8mb3.
      In the future it would be nice if the server could be capable of
      handling the character set mishap, but for now we just upgrade
      the table as the event subsystem is the only one that checks
      if a table is compatible.
[6 Aug 2008 13:33] Davi Arnaut
Queued to 6.0-bugteam
[7 Aug 2008 18:38] 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/51138

2744 Marc Alff	2008-08-07 [merge]
      Merge mysql-6.0-bugteam -> local bugfix branch
[12 Aug 2008 14:45] Bugs System
Pushed into 6.0.7-alpha  (revid:davi.arnaut@sun.com-20080805213614-shm7jp3xhd4b00v6) (version source revid:davi.arnaut@sun.com-20080812141852-8e6knbqclpfd8irn) (pib:3)
[14 Aug 2008 3:31] Paul DuBois
Noted in 6.0.7 changelog.

After an upgrade to MySQL 6.0.4 or higher, columns that used the old
3-byte Unicode utf8 character set are treated as having the utf8mb3 
character set. mysql_upgrade did not convert all system tables in the
mysql database to use the new 4-byte Unicode utf8 character set
rather than utf8mb3. This caused problems such as that the event
scheduler would not start. mysql_upgrade now performs the utf8mb3 to
utf8 conversion for system tables.
[14 Aug 2008 7:33] 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/51602

2684 He Zhenxing	2008-08-14 [merge]
      Merge 6.0 -> 6.0-rpl-testfixes
[14 Aug 2008 7:36] 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/51603

2684 He Zhenxing	2008-08-14 [merge]
      Merge 6.0 -> 6.0-rpl-testfixes
[28 Aug 2008 20:14] Bugs System
Pushed into 6.0.7-alpha  (revid:cbell@mysql.com-20080822132131-uveo6wiuecy6m2b8) (version source revid:cbell@mysql.com-20080822132131-uveo6wiuecy6m2b8) (pib:3)
[14 Sep 2008 1:03] Bugs System
Pushed into 6.0.7-alpha  (revid:davi.arnaut@sun.com-20080805213614-shm7jp3xhd4b00v6) (version source revid:vvaintroub@mysql.com-20080804094710-jb2qpqxpf2ir2gf3) (pib:3)