Bug #19122 Partitions: crash if alter rebuild
Submitted: 16 Apr 2006 0:34 Modified: 14 Jun 2006 0:56
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Partitions Severity:S3 (Non-critical)
Version:5.1.10-beta-debug OS:Linux (SUSE 10.0)
Assigned to: Mikael Ronström CPU Architecture:Any

[16 Apr 2006 0:34] Peter Gulutzan
Description:
I create a table, partitioned by key, engine=innodb.
I say ALTER REBUILD.
Crash.

How to repeat:
mysql> create table tpp (s1 int) partition by key (s1) (partition p1 engine=innodb);
Query OK, 0 rows affected (0.17 sec)

mysql> alter table tpp rebuild partition p1;
ERROR 2013 (HY000): Lost connection to MySQL server during query

On my other machine (SUSE 10.0 64-bit with a slightly more recent build)
the crash won't happen immediately, but I can persuade the server to hang
by repeating several times:
alter table tpp rebuild partition p1;
alter table tpp rebuild partition p1;
alter table tpp rebuild partition p1;
alter table tpp rebuild partition p1;
alter table tpp rebuild partition p1;
alter table tpp rebuild partition p1;
alter table tpp rebuild partition p1;
[16 Apr 2006 6:37] MySQL Verification Team
Thank you for the bug report.

060417  3:34:06 [Note] /home/miguel/dbs/5.1/libexec/mysqld: ready for connections.
Version: '5.1.10-beta-debug'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
[New Thread 1119902640 (LWP 31520)]
060417  3:34:48  InnoDB: Warning: MySQL is trying to drop table `test/tpp#P#p1#REN#`
InnoDB: though there are still open handles to it.
InnoDB: Adding the table to the background drop queue.
060417  3:34:49  InnoDB: Dropped table test/tpp#P#p1#REN# in background drop queue.

<cut>

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1119902640 (LWP 31523)]
0x08406f7d in row_get_mysql_key_number_for_index (index=0x0) at row0mysql.c:1637
warning: Source file is more recent than executable.

1637            ut_a(index);
Current language:  auto; currently c
(gdb)
[11 May 2006 12:31] Mikael Ronström
A name lock on the table is needed when the delete/rename of partitions starts up to ensure
that no one is starting to use the table before the delete/renames have been performed.
Also the handlers of the partitions need to be unlocked and closed before this.
[13 Jun 2006 12:24] Mikael Ronström
Patch will appear in 5.1.12
This patch also fixes duplicate bugs bug#19903 and bug#19830
[14 Jun 2006 0:56] 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 bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Documented bugfix in 5.1.12 changelog. Closed.