Bug #10707 select with select using primary key
Submitted: 18 May 2005 11:42 Modified: 28 Jun 2005 9:49
Reporter: Berto van de Kraats Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.0.6-beta-nightly-20050515-debug OS:Linux (linux)
Assigned to: Oleksandr Byelkin CPU Architecture:Any

[18 May 2005 11:42] Berto van de Kraats
Description:
mysql crashes if select within select takes place on primary key of table

How to repeat:
create table T1 ( c1 integer NOT NULL, c2 varchar(6) NOT NULL, PRIMARY KEY (`c1`));

insert into T1 values (   10 , 'A00');
insert into T1 values (   20 , 'B01');
insert into T1 values (   30 , 'C01');  
insert into T1 values (   50 , 'E01');

SELECT a0.c2 FROM T1 a0  WHERE a0.c2 IN (SELECT RPAD(a1.c2, 6, ' ') FROM T1 a1  WHERE (a1.c1 <= 30));
[18 May 2005 13:45] MySQL Verification Team
Thank you for the bug report.
[28 Jun 2005 9:49] Oleksandr Byelkin
Thank you for bugreport, but I can't repeat it any more on current 5.0 (and 4.1):
+ create table T1 ( c1 integer NOT NULL, c2 varchar(6) NOT NULL, PRIMARY KEY
+ (`c1`));
+ insert into T1 values (   10 , 'A00');
+ insert into T1 values (   20 , 'B01');
+ insert into T1 values (   30 , 'C01');
+ insert into T1 values (   50 , 'E01');
+ SELECT a0.c2 FROM T1 a0  WHERE a0.c2 IN (SELECT RPAD(a1.c2, 6, ' ') FROM T1
+ a1
+ WHERE (a1.c1 <= 30));
+ c2
+ A00
+ B01
+ C01