Bug #27565 killed query of SF() is not reported correctly
Submitted: 31 Mar 2007 18:56 Modified: 3 Aug 2007 15:38
Reporter: Andrei Elkin Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S3 (Non-critical)
Version:5.0.38/5.0BK OS:Linux (Linux)
Assigned to: Marc ALFF CPU Architecture:Any

[31 Mar 2007 18:56] Andrei Elkin
Description:
kill query some_conn_running_sf  - results effectively with breaking SF's execution but the error 

ERROR 1105 (HY000): Unknown error

is wrong

Note, that Bug#27563 "killing noticed in SF() stack but the error gets missed in action" represents the case where the client does not get no error at all.

How to repeat:
create table t1 (a int auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB;
create table t2 (a int auto_increment, b int, PRIMARY KEY (a)) ENGINE=MyISAM;
insert into t1 values (1,1);
insert into t2 values (1,1);

delimiter |;
create function bug27xxx() 
RETURNS int(11)
DETERMINISTIC
begin
  select a from t1 where a=1  into @a for update;
  return 1;
end|
delimiter ;|

connection killer;
begin; update t1 set b=0 where a=1;

connection sf;
send update t2 set b=bug27xxx()-1 where a=1;

connection killer;
eval kill query $ID;
commit;

connection sf;
reap;
select * from t2 /* must be as before: (1,1) */;
[2 Apr 2007 16:48] MySQL Verification Team
Thank you for the bug report. Verified as described.
[3 Aug 2007 15:38] Konstantin Osipov
Duplicate of Bug#27563, not repeatable any more.