Bug #54853 Assertion failure if using stored routines after unclean shutdown
Submitted: 28 Jun 2010 7:26 Modified: 28 Jun 2010 10:57
Reporter: Alexander Nozdrin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S2 (Serious)
Version:M3 (Celosia), M4 (Dahlia) OS:Any
Assigned to: Alexander Nozdrin CPU Architecture:Any

[28 Jun 2010 7:26] Alexander Nozdrin
Description:
If the server was not shutdown properly, on the next run
any DDL-statement related to stored routines causes
an assertion failure inside MDL.

How to repeat:
- Start the server
- Create a stored procedure (for instance):
  > use db1;
  > create procedure p1() select 1;
- Kill the server
- Start the server again
- Create another stored procedure:
  > create procedure p2() call p1();
  ERROR 2006 (HY000): MySQL server has gone away
  No connection. Trying to reconnect...
  Connection id:    1
  Current database: db1

  ERROR 2013 (HY000): Lost connection to MySQL server during query

The server log contains:
$ ./mysqld
...
Version: '5.5.6-m3-debug'  socket: '/home/alik/MySQL/var/mysql-trunk-bugfixing/mysqld.socket'  port: 3307  Source distribution
100628 11:19:42 [ERROR] ./mysqld: Table './mysql/proc' is marked as crashed and should be repaired
mysqld: /home/alik/MySQL/bzr/00/qqq/mysql-trunk-bugfixing/sql/mdl.cc:1919: bool MDL_context::acquire_locks(MDL_request_list*, ulong): Assertion `m_tickets.is_empty() || m_tickets.front() == m_trans_sentinel' failed.
Aborted
$
[28 Jun 2010 8:06] 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/112307

3080 Alexander Nozdrin	2010-06-28
      A patch for Bug#54853 (Assertion failure if using stored routines after unclean shutdown).
[28 Jun 2010 10:57] Alexander Nozdrin
The bug will be fixed by another patch in trunk-runtime.
Closing as no test is affected.