Commit 1b6d9589 authored by unknown's avatar unknown

Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime

into  alik.:/mnt/raid/alik/MySQL/devel/5.0-rt-bug16899

parents 2f0a610f 5d37fce9
44d03f27qNdqJmARzBoP3Is_cN5e0w 44d03f27qNdqJmARzBoP3Is_cN5e0w
44ec850ac2k4y2Omgr92GiWPBAVKGQ 44ec850ac2k4y2Omgr92GiWPBAVKGQ
44edb86b1iE5knJ97MbliK_3lCiAXA
...@@ -5387,4 +5387,11 @@ BEGIN ...@@ -5387,4 +5387,11 @@ BEGIN
RETURN 1; RETURN 1;
END| END|
ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY' is too long for host name (should be no longer than 60) 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; drop table t1,t2;
...@@ -6312,6 +6312,16 @@ BEGIN ...@@ -6312,6 +6312,16 @@ BEGIN
END| 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 # BUG#NNNN: New bug synopsis
# #
......
...@@ -421,11 +421,10 @@ void Item::rename(char *new_name) ...@@ -421,11 +421,10 @@ void Item::rename(char *new_name)
/* /*
transform() - traverse item tree possibly transforming it (replacing Traverse item tree possibly transforming it (replacing items).
items)
SYNOPSIS SYNOPSIS
transform() Item::transform()
transformer functor that performs transformation of a subtree transformer functor that performs transformation of a subtree
arg opaque argument passed to the functor arg opaque argument passed to the functor
...@@ -450,9 +449,9 @@ void Item::rename(char *new_name) ...@@ -450,9 +449,9 @@ void Item::rename(char *new_name)
it, please use Item::walk() instead. it, please use Item::walk() instead.
RETURN RETURN VALUE
Returns pointer to the new subtree root. THD::change_item_tree() 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. pointer to newly allocated item is returned.
*/ */
...@@ -5339,9 +5338,10 @@ int Item_default_value::save_in_field(Field *field_arg, bool no_conversions) ...@@ -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 This method like the walk method traverses the item tree, but at the
the same time it can replace some nodes in the tree same time it can replace some nodes in the tree
*/ */
Item *Item_default_value::transform(Item_transformer transformer, byte *args) Item *Item_default_value::transform(Item_transformer transformer, byte *args)
{ {
DBUG_ASSERT(!current_thd->is_stmt_prepare()); DBUG_ASSERT(!current_thd->is_stmt_prepare());
......
...@@ -1006,6 +1006,12 @@ sp_find_routine(THD *thd, int type, sp_name *name, sp_cache **cp, ...@@ -1006,6 +1006,12 @@ sp_find_routine(THD *thd, int type, sp_name *name, sp_cache **cp,
} }
DBUG_RETURN(sp->m_first_free_instance); 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; level= sp->m_last_cached_sp->m_recursion_level + 1;
if (level > depth) if (level > depth)
{ {
...@@ -1175,19 +1181,22 @@ sp_update_procedure(THD *thd, sp_name *name, st_sp_chistics *chistics) ...@@ -1175,19 +1181,22 @@ sp_update_procedure(THD *thd, sp_name *name, st_sp_chistics *chistics)
int int
sp_show_create_procedure(THD *thd, sp_name *name) sp_show_create_procedure(THD *thd, sp_name *name)
{ {
int ret= SP_KEY_NOT_FOUND;
sp_head *sp; sp_head *sp;
DBUG_ENTER("sp_show_create_procedure"); DBUG_ENTER("sp_show_create_procedure");
DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str)); 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, if ((sp= sp_find_routine(thd, TYPE_ENUM_PROCEDURE, name,
&thd->sp_proc_cache, FALSE))) &thd->sp_proc_cache, FALSE)))
{ ret= sp->show_create_procedure(thd);
int ret= sp->show_create_procedure(thd);
DBUG_RETURN(ret); thd->variables.max_sp_recursion_depth--;
} DBUG_RETURN(ret);
DBUG_RETURN(SP_KEY_NOT_FOUND);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment