Bug #23631 Events: SHOW VARIABLES doesn't work when mysql.event is damaged
Submitted: 25 Oct 2006 15:43 Modified: 11 Apr 2007 2:02
Reporter: Sergei Golubchik Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S2 (Serious)
Version:5.1 OS:Any
Assigned to: Konstantin Osipov CPU Architecture:Any

[25 Oct 2006 15:43] Sergei Golubchik
Description:
mysql> show variables;
ERROR 1566 (HY000): Cannot proceed because the tables used by events were found damaged at server start

if "tables used by events" are "damaged", it's not a reason to abort SHOW VARIABLES

How to repeat:
[8 Feb 2007 13:02] Tomash Brechko
Can't repeat with 5.1.15:

Server log:

070208 15:51:12 [ERROR] Column count of mysql.event is wrong. Expected 16, found 17. Table probably corrupted
<more errors here>
070208 15:51:12 [ERROR] SCHEDULER: Table mysql.event is damaged. Can not open
070208 15:51:12 [Note] SCHEDULER: Purging queue. 0 events
070208 15:51:12 [ERROR] SCHEDULER: Error while loading from disk.

Then:

mysql> show variables;
...
237 rows in set (0.00 sec)
[8 Feb 2007 14:31] Sergei Golubchik
Still the same on the latest pull.
Try older tables. E.g. remove mysql-even completely. That's what I have:
-----------------
Version: '5.1.16-beta-debug'  socket: '/home/serg/Abk/binaries/var/mysql.sock'  port: 0  Source distribution
070208 15:28:52 [ERROR] Column count of mysql.db is wrong. Expected 22, found 15. Created with MySQL 0, now running 50116. Please use scripts/mysql_fix_privilege_tables
070208 15:28:52 [ERROR] mysql.user has no `Event_priv` column at position 29
070208 15:28:52 [ERROR] SCHEDULER: The system tables are damaged. The scheduler subsystem will be unusable during this run.
-----------------
[8 Feb 2007 15:41] Tomash Brechko
OK, reproduced when MySQL 5.1 is started with 4.0 tables.
[27 Mar 2007 22:15] 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/23084

ChangeSet@1.2524, 2007-03-28 02:15:45+04:00, kostja@bodhi.local +37 -0
  A set of changes aiming to make the Event Scheduler more user-friendly
  when there are no up-to-date system tables to support it:
   - initialize the scheduler before reporting "Ready for connections".
     This ensures that warnings, if any, are printed before "Ready for
     connections", and this message is not mangled.
   - do not abort the scheduler if there are no system tables
   - check the tables once at start up, remember the status and disable
     the scheduler if the tables are not up to date.
     If one attempts to use the scheduler with bad tables,
     issue an error message.
   - clean up the behaviour of the module under LOCK TABLES and pre-locking
     mode
   - make sure implicit commit of Events DDL works as expected.
   - add more tests
  
  
  Collateral clean ups in the events code.
  
  This patch fixes Bug#23631 Events: SHOW VARIABLES doesn't work 
  when mysql.event is damaged
[5 Apr 2007 11:26] 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/23886

ChangeSet@1.2524, 2007-04-05 15:24:34+04:00, kostja@vajra.(none) +37 -0
  A set of changes aiming to make the Event Scheduler more user-friendly
  when there are no up-to-date system tables to support it:
   - initialize the scheduler before reporting "Ready for connections".
     This ensures that warnings, if any, are printed before "Ready for
     connections", and this message is not mangled.
   - do not abort the scheduler if there are no system tables
   - check the tables once at start up, remember the status and disable
     the scheduler if the tables are not up to date.
     If one attempts to use the scheduler with bad tables,
     issue an error message.
   - clean up the behaviour of the module under LOCK TABLES and pre-locking
     mode
   - make sure implicit commit of Events DDL works as expected.
   - add more tests
  
  
  Collateral clean ups in the events code.
  
  This patch fixes Bug#23631 Events: SHOW VARIABLES doesn't work 
  when mysql.event is damaged
[5 Apr 2007 16:47] 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/23913

ChangeSet@1.2556, 2007-04-05 20:47:22+04:00, kostja@vajra.(none) +12 -0
  Post-merge and post-review fixes for the patch for
  Bug#23631 "Events: SHOW VARIABLES doesn't work when mysql.event 
  is damaged:
[5 Apr 2007 17:46] Konstantin Osipov
Queued into 5.1-runtime
[6 Apr 2007 17:24] Bugs System
Pushed into 5.1.18-beta
[11 Apr 2007 2:02] 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

    http://dev.mysql.com/doc/en/installing-source.html

Documented bugfix in 5.1.18 changelog.