Bug #1839 Delete with single row subquery causes lost of connection

Submitted: 14 Nov 2003 10:59 Modified: 17 Nov 2003 2:32
Reporter: Igor Babaev Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:4.1.1 OS:Any (All)
Assigned to: Oleksandr Byelkin CPU Architecture:Any

[14 Nov 2003 10:59] Igor Babaev
Description:
If the where condition in a delete statement contains a single row sub-query 
whose result set happens to have more that 1 rows (error 1241) then the 
execution of this statement might cause lost of connection. The failure occurs 
for the sdelete statements with any dependent sub-query returning more than 1 
rows and for the delete statements with dependent subqueries used in any 
predicates except '='. 

How to repeat:
This a slightly modified example from subselect.test: 
 
create table t11 (a int NOT NULL, b int, primary key (a)); 
create table t12 (a int NOT NULL, b int, primary key (a)); 
create table t2 (a int NOT NULL, b int, primary key (a)); 
insert into t11 values (0, 10),(1, 11),(2, 12); 
insert into t12 values (33, 10),(22, 11),(2, 12); 
insert into t2 values (1, 21),(2, 12),(3, 23); 
select * from t11; 
select * from t12; 
select * from t2; 
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b > (select b 
from t2); 
select * from t2;
[15 Nov 2003 11:54] Oleksandr Byelkin
ChangeSet 
  1.1600 03/11/15 21:52:21 bell@sanja.is.com.ua +3 -0 
  fixed error handling inside su_select() for multidelete 
  (BUG#1839)
[17 Nov 2003 2:32] Oleksandr Byelkin
Thank you for bugreport. Patch for this bug is pushed in source repository

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.039 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.