mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
Fix for BUG#13549 "Server crash with nested stored procedures
if inner routine has more local variables than outer one, and one of its last variables was used as argument to NOT operator". THD::spcont was non-0 when we were parsing stored routine/trigger definition during execution of another stored routine. This confused methods of Item_splocal and forced them use wrong runtime context. Fix ensures that we always have THD::spcont equal to zero during routine/trigger body parsing. This also allows to avoid problems with errors which occur during parsing and SQL exception handlers.
This commit is contained in:
@@ -738,3 +738,17 @@ f1
|
||||
1
|
||||
drop trigger t1_bi;
|
||||
drop tables t1, t2;
|
||||
create table t1 (a int);
|
||||
drop procedure if exists p2;
|
||||
CREATE PROCEDURE `p2`()
|
||||
begin
|
||||
insert into t1 values (1);
|
||||
end//
|
||||
create trigger trg before insert on t1 for each row
|
||||
begin
|
||||
declare done int default 0;
|
||||
set done= not done;
|
||||
end//
|
||||
CALL p2();
|
||||
drop procedure p2;
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user