mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-36814 MariaDB 10.11.9 Signal 11 crash on second Stored Procedure call
don't reset thd->lex->current_select, it's not a leftover from previous parsing, it's set in reinit_stmt_before_use()
This commit is contained in:
@@ -42,4 +42,21 @@ t1test(1)
|
|||||||
wrbyviwb
|
wrbyviwb
|
||||||
drop function t1test;
|
drop function t1test;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
#
|
||||||
|
# MDEV-36814 MariaDB 10.11.9 Signal 11 crash on second Stored Procedure call
|
||||||
|
#
|
||||||
|
set names utf8;
|
||||||
|
create table t1 (a varchar(1000));
|
||||||
|
create procedure p1(in p_a varchar(1000)) insert into t1 values (p_a);//
|
||||||
|
create procedure p2(in s varchar(10))
|
||||||
|
begin
|
||||||
|
if s = '1' then set @startDate = now(); end if;
|
||||||
|
if s = '2' then set @startDate = '2025-05-23'; end if;
|
||||||
|
call p1(concat(s, @startDate, ' and '));
|
||||||
|
end;//
|
||||||
|
call p2('1');
|
||||||
|
call p2('2');
|
||||||
|
drop table t1;
|
||||||
|
drop procedure p1;
|
||||||
|
drop procedure p2;
|
||||||
# End of 10.11 tests
|
# End of 10.11 tests
|
||||||
|
@@ -47,4 +47,24 @@ select t1test(1);
|
|||||||
drop function t1test;
|
drop function t1test;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-36814 MariaDB 10.11.9 Signal 11 crash on second Stored Procedure call
|
||||||
|
--echo #
|
||||||
|
set names utf8;
|
||||||
|
create table t1 (a varchar(1000));
|
||||||
|
--delimiter //
|
||||||
|
create procedure p1(in p_a varchar(1000)) insert into t1 values (p_a);//
|
||||||
|
create procedure p2(in s varchar(10))
|
||||||
|
begin
|
||||||
|
if s = '1' then set @startDate = now(); end if;
|
||||||
|
if s = '2' then set @startDate = '2025-05-23'; end if;
|
||||||
|
call p1(concat(s, @startDate, ' and '));
|
||||||
|
end;//
|
||||||
|
--delimiter ;
|
||||||
|
call p2('1');
|
||||||
|
call p2('2');
|
||||||
|
drop table t1;
|
||||||
|
drop procedure p1;
|
||||||
|
drop procedure p2;
|
||||||
|
|
||||||
--echo # End of 10.11 tests
|
--echo # End of 10.11 tests
|
||||||
|
@@ -3072,11 +3072,6 @@ static bool do_execute_sp(THD *thd, sp_head *sp)
|
|||||||
ha_rows select_limit= thd->variables.select_limit;
|
ha_rows select_limit= thd->variables.select_limit;
|
||||||
thd->variables.select_limit= HA_POS_ERROR;
|
thd->variables.select_limit= HA_POS_ERROR;
|
||||||
|
|
||||||
/*
|
|
||||||
Reset current_select as it may point to random data as a
|
|
||||||
result of previous parsing.
|
|
||||||
*/
|
|
||||||
thd->lex->current_select= NULL;
|
|
||||||
thd->lex->in_sum_func= 0; // For Item_field::fix_fields()
|
thd->lex->in_sum_func= 0; // For Item_field::fix_fields()
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user