Loading BitKeeper/etc/collapsed +1 −0 Original line number Diff line number Diff line 44d03f27qNdqJmARzBoP3Is_cN5e0w 44ec850ac2k4y2Omgr92GiWPBAVKGQ 44edb86b1iE5knJ97MbliK_3lCiAXA mysql-test/r/sp.result +7 −0 Original line number Diff line number Diff line Loading @@ -5387,4 +5387,11 @@ BEGIN RETURN 1; END| ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY' is too long for host name (should be no longer than 60) drop procedure if exists bug21416| create procedure bug21416() show create procedure bug21416| call bug21416()| Procedure sql_mode Create Procedure bug21416 CREATE DEFINER=`root`@`localhost` PROCEDURE `bug21416`() show create procedure bug21416 drop procedure bug21416| drop table t1,t2; mysql-test/t/sp.test +10 −0 Original line number Diff line number Diff line Loading @@ -6312,6 +6312,16 @@ BEGIN END| # # BUG#21416: SP: Recursion level higher than zero needed for non-recursive call # --disable_warnings drop procedure if exists bug21416| --enable_warnings create procedure bug21416() show create procedure bug21416| call bug21416()| drop procedure bug21416| # # BUG#NNNN: New bug synopsis # Loading sql/item.cc +7 −7 Original line number Diff line number Diff line Loading @@ -421,11 +421,10 @@ void Item::rename(char *new_name) /* transform() - traverse item tree possibly transforming it (replacing items) Traverse item tree possibly transforming it (replacing items). SYNOPSIS transform() Item::transform() transformer functor that performs transformation of a subtree arg opaque argument passed to the functor Loading @@ -450,9 +449,9 @@ void Item::rename(char *new_name) it, please use Item::walk() instead. RETURN RETURN VALUE Returns pointer to the new subtree root. THD::change_item_tree() should be called for it if transformation took place, i.e. if should be called for it if transformation took place, i.e. if a pointer to newly allocated item is returned. */ Loading Loading @@ -5339,9 +5338,10 @@ int Item_default_value::save_in_field(Field *field_arg, bool no_conversions) /* This method like the walk method traverses the item tree, but at the same time it can replace some nodes in the tree This method like the walk method traverses the item tree, but at the same time it can replace some nodes in the tree */ Item *Item_default_value::transform(Item_transformer transformer, byte *args) { DBUG_ASSERT(!current_thd->is_stmt_prepare()); Loading sql/sp.cc +15 −6 Original line number Diff line number Diff line Loading @@ -1006,6 +1006,12 @@ sp_find_routine(THD *thd, int type, sp_name *name, sp_cache **cp, } DBUG_RETURN(sp->m_first_free_instance); } /* Actually depth could be +1 than the actual value in case a SP calls SHOW CREATE PROCEDURE. Hence, the linked list could hold up to one more instance. */ level= sp->m_last_cached_sp->m_recursion_level + 1; if (level > depth) { Loading Loading @@ -1175,21 +1181,24 @@ sp_update_procedure(THD *thd, sp_name *name, st_sp_chistics *chistics) int sp_show_create_procedure(THD *thd, sp_name *name) { int ret= SP_KEY_NOT_FOUND; sp_head *sp; DBUG_ENTER("sp_show_create_procedure"); DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str)); /* Increase the recursion limit for this statement. SHOW CREATE PROCEDURE does not do actual recursion. */ thd->variables.max_sp_recursion_depth++; if ((sp= sp_find_routine(thd, TYPE_ENUM_PROCEDURE, name, &thd->sp_proc_cache, FALSE))) { int ret= sp->show_create_procedure(thd); ret= sp->show_create_procedure(thd); thd->variables.max_sp_recursion_depth--; DBUG_RETURN(ret); } DBUG_RETURN(SP_KEY_NOT_FOUND); } int sp_show_status_procedure(THD *thd, const char *wild) Loading Loading
BitKeeper/etc/collapsed +1 −0 Original line number Diff line number Diff line 44d03f27qNdqJmARzBoP3Is_cN5e0w 44ec850ac2k4y2Omgr92GiWPBAVKGQ 44edb86b1iE5knJ97MbliK_3lCiAXA
mysql-test/r/sp.result +7 −0 Original line number Diff line number Diff line Loading @@ -5387,4 +5387,11 @@ BEGIN RETURN 1; END| ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY' is too long for host name (should be no longer than 60) drop procedure if exists bug21416| create procedure bug21416() show create procedure bug21416| call bug21416()| Procedure sql_mode Create Procedure bug21416 CREATE DEFINER=`root`@`localhost` PROCEDURE `bug21416`() show create procedure bug21416 drop procedure bug21416| drop table t1,t2;
mysql-test/t/sp.test +10 −0 Original line number Diff line number Diff line Loading @@ -6312,6 +6312,16 @@ BEGIN END| # # BUG#21416: SP: Recursion level higher than zero needed for non-recursive call # --disable_warnings drop procedure if exists bug21416| --enable_warnings create procedure bug21416() show create procedure bug21416| call bug21416()| drop procedure bug21416| # # BUG#NNNN: New bug synopsis # Loading
sql/item.cc +7 −7 Original line number Diff line number Diff line Loading @@ -421,11 +421,10 @@ void Item::rename(char *new_name) /* transform() - traverse item tree possibly transforming it (replacing items) Traverse item tree possibly transforming it (replacing items). SYNOPSIS transform() Item::transform() transformer functor that performs transformation of a subtree arg opaque argument passed to the functor Loading @@ -450,9 +449,9 @@ void Item::rename(char *new_name) it, please use Item::walk() instead. RETURN RETURN VALUE Returns pointer to the new subtree root. THD::change_item_tree() should be called for it if transformation took place, i.e. if should be called for it if transformation took place, i.e. if a pointer to newly allocated item is returned. */ Loading Loading @@ -5339,9 +5338,10 @@ int Item_default_value::save_in_field(Field *field_arg, bool no_conversions) /* This method like the walk method traverses the item tree, but at the same time it can replace some nodes in the tree This method like the walk method traverses the item tree, but at the same time it can replace some nodes in the tree */ Item *Item_default_value::transform(Item_transformer transformer, byte *args) { DBUG_ASSERT(!current_thd->is_stmt_prepare()); Loading
sql/sp.cc +15 −6 Original line number Diff line number Diff line Loading @@ -1006,6 +1006,12 @@ sp_find_routine(THD *thd, int type, sp_name *name, sp_cache **cp, } DBUG_RETURN(sp->m_first_free_instance); } /* Actually depth could be +1 than the actual value in case a SP calls SHOW CREATE PROCEDURE. Hence, the linked list could hold up to one more instance. */ level= sp->m_last_cached_sp->m_recursion_level + 1; if (level > depth) { Loading Loading @@ -1175,21 +1181,24 @@ sp_update_procedure(THD *thd, sp_name *name, st_sp_chistics *chistics) int sp_show_create_procedure(THD *thd, sp_name *name) { int ret= SP_KEY_NOT_FOUND; sp_head *sp; DBUG_ENTER("sp_show_create_procedure"); DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str)); /* Increase the recursion limit for this statement. SHOW CREATE PROCEDURE does not do actual recursion. */ thd->variables.max_sp_recursion_depth++; if ((sp= sp_find_routine(thd, TYPE_ENUM_PROCEDURE, name, &thd->sp_proc_cache, FALSE))) { int ret= sp->show_create_procedure(thd); ret= sp->show_create_procedure(thd); thd->variables.max_sp_recursion_depth--; DBUG_RETURN(ret); } DBUG_RETURN(SP_KEY_NOT_FOUND); } int sp_show_status_procedure(THD *thd, const char *wild) Loading