Bug #9771 Some statements prevent further error returns in stored procedures
Submitted: 8 Apr 2005 18:38 Modified: 12 Apr 2005 16:30
Reporter: Per-Erik Martin Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0 OS:Any (Any)
Assigned to: CPU Architecture:Any

[8 Apr 2005 18:38] Per-Erik Martin
Description:
Certain statements (the currently only known example: a simple select) prevents
errors in later statements from being return, causing the client to hang.

How to repeat:
create table t1 ( x int );

delimiter //
create procedure p1()
begin
  declare c cursor for select x from t1;
  close c;
end//
create procedure p2()
begin
  declare c cursor for select x from t1;
  select 'Boo';
  close c;
end//
delimiter ;

-- this returns the expected error
call p1();
-- this will hang
call p2();
[12 Apr 2005 16:30] Per-Erik Martin
This turned out to be a duplicate of BUG#9367.