mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 05:22:25 +01: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:
parent
ff665c9513
commit
189d6b502b
3 changed files with 26 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue