Loading mysql-test/r/sp.result +17 −0 Original line number Diff line number Diff line Loading @@ -3667,4 +3667,21 @@ call bug14845()| a 0 drop procedure bug14845| drop procedure bug12589_1| drop procedure bug12589_2| drop procedure bug12589_3| drop procedure if exists bug13549_1| drop procedure if exists bug13549_2| CREATE PROCEDURE `bug13549_2`() begin call bug13549_1(); end| CREATE PROCEDURE `bug13549_1`() begin declare done int default 0; set done= not done; end| CALL bug13549_2()| drop procedure bug13549_2| drop procedure bug13549_1| drop table t1,t2; mysql-test/r/trigger.result +14 −0 Original line number Diff line number Diff line Loading @@ -763,3 +763,17 @@ ERROR HY000: Table 't3' was not locked with LOCK TABLES deallocate prepare stmt1; drop procedure p1; drop table t1, t2, t3; 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; mysql-test/t/sp.test +28 −0 Original line number Diff line number Diff line Loading @@ -4291,6 +4291,9 @@ call bug12589_1()| # No warnings here call bug12589_2()| call bug12589_3()| drop procedure bug12589_1| drop procedure bug12589_2| drop procedure bug12589_3| # # BUG#7049: Stored procedure CALL errors are ignored Loading Loading @@ -4594,6 +4597,31 @@ end| call bug14845()| drop procedure bug14845| # # BUG#13549 "Server crash with nested stored procedures". # Server should not crash when during execution of stored procedure # we have to parse trigger/function definition and this new trigger/ # function has more local variables declared than invoking stored # procedure and last of these variables is used in argument of NOT # operator. # --disable_warnings drop procedure if exists bug13549_1| drop procedure if exists bug13549_2| --enable_warnings CREATE PROCEDURE `bug13549_2`() begin call bug13549_1(); end| CREATE PROCEDURE `bug13549_1`() begin declare done int default 0; set done= not done; end| CALL bug13549_2()| drop procedure bug13549_2| drop procedure bug13549_1| # # BUG#NNNN: New bug synopsis # Loading mysql-test/t/trigger.test +28 −0 Original line number Diff line number Diff line Loading @@ -914,3 +914,31 @@ call p1(); deallocate prepare stmt1; drop procedure p1; drop table t1, t2, t3; # # BUG#13549 "Server crash with nested stored procedures". # Server should not crash when during execution of stored procedure # we have to parse trigger/function definition and this new trigger/ # function has more local variables declared than invoking stored # procedure and last of these variables is used in argument of NOT # operator. # create table t1 (a int); --disable_warnings drop procedure if exists p2; --enable_warnings DELIMITER //; 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// DELIMITER ;// CALL p2(); drop procedure p2; drop table t1; sql/item.cc +7 −0 Original line number Diff line number Diff line Loading @@ -894,6 +894,7 @@ bool Item_splocal::is_null() Item * Item_splocal::this_item() { DBUG_ASSERT(owner == thd->spcont->owner); return thd->spcont->get_item(m_offset); } Loading @@ -901,12 +902,14 @@ Item_splocal::this_item() Item ** Item_splocal::this_item_addr(THD *thd, Item **addr) { DBUG_ASSERT(owner == thd->spcont->owner); return thd->spcont->get_item_addr(m_offset); } Item * Item_splocal::this_const_item() const { DBUG_ASSERT(owner == thd->spcont->owner); return thd->spcont->get_item(m_offset); } Loading @@ -914,7 +917,11 @@ Item::Type Item_splocal::type() const { if (thd && thd->spcont) { DBUG_ASSERT(owner == thd->spcont->owner); return thd->spcont->get_item(m_offset)->type(); } } return NULL_ITEM; // Anything but SUBSELECT_ITEM } Loading Loading
mysql-test/r/sp.result +17 −0 Original line number Diff line number Diff line Loading @@ -3667,4 +3667,21 @@ call bug14845()| a 0 drop procedure bug14845| drop procedure bug12589_1| drop procedure bug12589_2| drop procedure bug12589_3| drop procedure if exists bug13549_1| drop procedure if exists bug13549_2| CREATE PROCEDURE `bug13549_2`() begin call bug13549_1(); end| CREATE PROCEDURE `bug13549_1`() begin declare done int default 0; set done= not done; end| CALL bug13549_2()| drop procedure bug13549_2| drop procedure bug13549_1| drop table t1,t2;
mysql-test/r/trigger.result +14 −0 Original line number Diff line number Diff line Loading @@ -763,3 +763,17 @@ ERROR HY000: Table 't3' was not locked with LOCK TABLES deallocate prepare stmt1; drop procedure p1; drop table t1, t2, t3; 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;
mysql-test/t/sp.test +28 −0 Original line number Diff line number Diff line Loading @@ -4291,6 +4291,9 @@ call bug12589_1()| # No warnings here call bug12589_2()| call bug12589_3()| drop procedure bug12589_1| drop procedure bug12589_2| drop procedure bug12589_3| # # BUG#7049: Stored procedure CALL errors are ignored Loading Loading @@ -4594,6 +4597,31 @@ end| call bug14845()| drop procedure bug14845| # # BUG#13549 "Server crash with nested stored procedures". # Server should not crash when during execution of stored procedure # we have to parse trigger/function definition and this new trigger/ # function has more local variables declared than invoking stored # procedure and last of these variables is used in argument of NOT # operator. # --disable_warnings drop procedure if exists bug13549_1| drop procedure if exists bug13549_2| --enable_warnings CREATE PROCEDURE `bug13549_2`() begin call bug13549_1(); end| CREATE PROCEDURE `bug13549_1`() begin declare done int default 0; set done= not done; end| CALL bug13549_2()| drop procedure bug13549_2| drop procedure bug13549_1| # # BUG#NNNN: New bug synopsis # Loading
mysql-test/t/trigger.test +28 −0 Original line number Diff line number Diff line Loading @@ -914,3 +914,31 @@ call p1(); deallocate prepare stmt1; drop procedure p1; drop table t1, t2, t3; # # BUG#13549 "Server crash with nested stored procedures". # Server should not crash when during execution of stored procedure # we have to parse trigger/function definition and this new trigger/ # function has more local variables declared than invoking stored # procedure and last of these variables is used in argument of NOT # operator. # create table t1 (a int); --disable_warnings drop procedure if exists p2; --enable_warnings DELIMITER //; 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// DELIMITER ;// CALL p2(); drop procedure p2; drop table t1;
sql/item.cc +7 −0 Original line number Diff line number Diff line Loading @@ -894,6 +894,7 @@ bool Item_splocal::is_null() Item * Item_splocal::this_item() { DBUG_ASSERT(owner == thd->spcont->owner); return thd->spcont->get_item(m_offset); } Loading @@ -901,12 +902,14 @@ Item_splocal::this_item() Item ** Item_splocal::this_item_addr(THD *thd, Item **addr) { DBUG_ASSERT(owner == thd->spcont->owner); return thd->spcont->get_item_addr(m_offset); } Item * Item_splocal::this_const_item() const { DBUG_ASSERT(owner == thd->spcont->owner); return thd->spcont->get_item(m_offset); } Loading @@ -914,7 +917,11 @@ Item::Type Item_splocal::type() const { if (thd && thd->spcont) { DBUG_ASSERT(owner == thd->spcont->owner); return thd->spcont->get_item(m_offset)->type(); } } return NULL_ITEM; // Anything but SUBSELECT_ITEM } Loading