Bug #20852 Partitions: crash if hash, innodb, composite primary key
Submitted: 4 Jul 2006 18:36 Modified: 19 Jul 2006 4:29
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Partitions Severity:S3 (Non-critical)
Version:5.1.12-beta-debug OS:Linux (SUSE 10.0 / 64-bit)
Assigned to: Mikael Ronström CPU Architecture:Any

[4 Jul 2006 18:36] Peter Gulutzan
I create an InnoDB table with a 3-column primary key.
The last column in the primary key is the partition column (partition by hash).
I put 1,000 rows in the table.
I try to update one row.
The consequences are severe -- I have to 'kill -9' to get rid of the server.

How to repeat:
create procedure pc ()
  declare v int default 0;
  create table t (s1 int, s2 timestamp, s3 decimal(10), primary key (s3,s2,s1)) engine=innodb partition by hash (s1);
  while v < 1000 do
    select 'insert', v;
    insert into t values (v, current_timestamp, 0);
    set v = v + 1;
    end while;
  update t set s3 = s3 + 1, s2 = current_timestamp where s1 = 462;
call pc()//
[4 Jul 2006 19:00] Miguel Solorzano
Thank you for the bug report.
[12 Jul 2006 12:38] Mikael Ronström
It seems to be a InnoDB bug related to using rnd_init/rnd_next in an update
that changes the primary key.
[12 Jul 2006 22:52] Mikael Ronström
Fixed two missing variable assignments which are part of the handler interface
[18 Jul 2006 8:56] Mikael Ronström
Will appear in 5.1.12
[19 Jul 2006 4:29] Jon Stephens
Documented bugfix in 5.1.12 changelog.