Bug #28521 Upgrade from 5.1.17 to 5.1.18 breaks events
Submitted: 18 May 2007 15:29 Modified: 10 Jun 2007 18:48
Reporter: David Shrewsbury Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Stored Routines Severity:S1 (Critical)
Version:5.1.18 OS:Linux
Assigned to: Magnus BlÄudd CPU Architecture:Any

[18 May 2007 15:29] David Shrewsbury
I just upgraded from 5.1.17 to 5.1.18. I ran the mysql_upgrade script (see output below). After running the upgrade script, I see [ERROR] messages in the server error logs regarding the mysql.event table. These errors are:

Before running mysql_upgrade:
070518 11:23:30 [ERROR] Column count of mysql.event is wrong. Expected 18, found 17. Created with MySQL 50117, now running 50118. Please use mysql_upgrade to fix this error.

After running mysql_upgrade:
070518 10:56:33 [ERROR] Incorrect definition of table mysql.event: expected column 'originator' at position 16, found 'time_zone'.
070518 10:56:33 [ERROR] Incorrect definition of table mysql.event: expected column 'originator' at position 16 to have type int(10), found type char(64).
070518 10:56:33 [ERROR] Incorrect definition of table mysql.event: expected column 'time_zone' at position 17, found 'originator'.
070518 10:56:33 [ERROR] Incorrect definition of table mysql.event: expected column 'time_zone' at position 17 to have type char(64), found type int(10).
070518 10:56:33 [ERROR] Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.

I ran mysql_fix_privilege_tables by hand, and this did not fix the issue either.

Below is the output of mysql_upgrade:

shell> mysql_upgrade --user=root --password=xxxx --verbose
Looking for 'mysql' in: /usr/local/mysql-5.1.18-beta-linux-x86_64-glibc23/bin/mysql
Looking for 'mysqlcheck' in: /usr/local/mysql-5.1.18-beta-linux-x86_64-glibc23/bin/mysqlcheck
Running 'mysqlcheck'...
crf.bll_srch_types                                 OK
crf.hosts                                          OK
crf.lug_dbs                                        OK
crf.lug_retcodes                                   OK
crf.prf_apr                                        OK
crf.prf_aug                                        OK
crf.prf_dec                                        OK
crf.prf_feb                                        OK
crf.prf_jan                                        OK
crf.prf_jul                                        OK
crf.prf_jun                                        OK
crf.prf_mar                                        OK
crf.prf_may                                        OK
crf.prf_nov                                        OK
crf.prf_oct                                        OK
crf.prf_sep                                        OK
crf.profiles                                       OK
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.event                                        OK
mysql.func                                         OK
mysql.general_log                                  OK
mysql.help_category                                OK
mysql.help_keyword                                 OK
mysql.help_relation                                OK
mysql.help_topic                                   OK
mysql.host                                         OK
mysql.ndb_binlog_index                             OK
mysql.plugin                                       OK
mysql.proc                                         OK
mysql.procs_priv                                   OK
mysql.servers                                      OK
mysql.slow_log                                     OK
mysql.tables_priv                                  OK
mysql.time_zone                                    OK
mysql.time_zone_leap_second                        OK
mysql.time_zone_name                               OK
mysql.time_zone_transition                         OK
mysql.time_zone_transition_type                    OK
mysql.user                                         OK
mysql.user_info                                    OK
Running 'mysql_fix_privilege_tables'...

How to repeat:
1) Install 5.1.17.

2) Upgrade to 5.1.18 using the Linux tar package (mysql-5.1.18-beta-linux-x86_64-glibc23.tar.gz or mysql-5.1.18-beta-linux-i686-glibc23.tar.gz)

3) Run mysql_upgrade
[18 May 2007 15:33] David Shrewsbury
Note that the BEFORE and AFTER messages from the error log above have different timestamps because they came from two different machines that I tested this on, so ignore the fact that the BEFORE timestamp is later than the AFTER.  :-)
[19 May 2007 16:55] 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:


ChangeSet@1.2501, 2007-05-19 18:55:38+02:00, msvensson@pilot.blaudden +3 -0
  Bug#28521 Upgrade from 5.1.17 to 5.1.18 breaks events
   - Add test for upgrading from 5.1.17 - it's a beta but anyway
     good to have a check oif upgrading new system tables for 5.1
   - Always put the "originator" column after "comment" to get correct
    order of columns in "events" table
[6 Jun 2007 16:54] Bugs System
Pushed into 5.1.20-beta
[10 Jun 2007 18:48] Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at


Documented fix in 5.1.20 changelog. Added warnings to 5.1.18 changelog and Event Scheduler Limitations section of 5.1 Manual.