Bug #14643 Stored Procedure: Continuing after failed var. initialization crashes server.
Submitted: 4 Nov 2005 14:13 Modified: 30 Nov 2005 18:04
Reporter: Per-Erik Martin Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Stored Routines Severity:S2 (Serious)
Version:bk 5.0.16 OS:Any (Any)
Assigned to: Bugs System

[4 Nov 2005 14:13] Per-Erik Martin
Continuing (with the help of a condition handler) after a variable initialization has failed crashes the server.
This can happen either with an explicit variable (as in 'p' in the example) or with the implicit variable in the simple CASE statement ('q' in the example).

How to repeat:
delimiter //
create procedure p()
  declare continue handler for sqlexception select 'boo';
    declare v int default x;

    if v then
      select 1;
    end if;
create procedure q()
  declare continue handler for sqlexception select 'boo';

  case x
  when 1 then
    select 1;
  end case;
delimiter ;

call p();
-- restart server
call q();
[8 Nov 2005 13:50] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

[28 Nov 2005 11:10] Konstantin Osipov
OK to push.
[28 Nov 2005 14:43] Per-Erik Martin
Pushed to 5.0.17 bk.
[30 Nov 2005 18:04] Paul Dubois
Noted in 5.0.17 changelog.