Commit 189d6b50 authored by pem@mysql.comhem.se's avatar pem@mysql.comhem.se

Fixed BUG#6898: Stored procedure crash if GOTO statements exist

  Bug in the optimizer caused an infinite loop for weird code.
parent ff665c95
......@@ -2958,4 +2958,13 @@ select @x|
set global query_cache_size = @qcs1|
delete from t1|
drop function bug9902|
drop procedure if exists bug6898|
create procedure bug6898()
begin
goto label1;
label label1;
begin end;
goto label1;
end|
drop procedure bug6898|
drop table t1,t2;
......@@ -3628,6 +3628,22 @@ delete from t1|
drop function bug9902|
#
# BUG#6898: Stored procedure crash if GOTO statements exist
#
--disable_warnings
drop procedure if exists bug6898|
--enable_warnings
create procedure bug6898()
begin
goto label1;
label label1;
begin end;
goto label1;
end|
drop procedure bug6898|
#
# BUG#NNNN: New bug synopsis
#
......
......@@ -1499,7 +1499,7 @@ sp_instr_jump::opt_shortcut_jump(sp_head *sp, sp_instr *start)
{
uint ndest;
if (start == i)
if (start == i || this == i)
break;
ndest= i->opt_shortcut_jump(sp, start);
if (ndest == dest)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment