mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Fixed BUG#6898: Stored procedure crash if GOTO statements exist
Bug in the optimizer caused an infinite loop for weird code.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user