summaryrefslogtreecommitdiff
path: root/sql/sp.cc
diff options
context:
space:
mode:
authorDmitry Shulga <Dmitry.Shulga@Sun.COM>2010-10-21 15:41:13 +0700
committerDmitry Shulga <Dmitry.Shulga@Sun.COM>2010-10-21 15:41:13 +0700
commit89e43c84943da707d72f168c48b86c41f8a05aff (patch)
tree0c9772ec45e046e8dc88c8cd6eb0372223cff4cc /sql/sp.cc
parent2d77e26d0bba005eedc53b3edc4ac7c0e18d6331 (diff)
downloadmariadb-git-89e43c84943da707d72f168c48b86c41f8a05aff.tar.gz
Fixed bug#45445 - cannot execute procedures with thread_stack
set to 128k. sql/sp.cc: Added checking for stack overrun at functions db_load_routine/sp_find_routine. sql/sp_head.cc: sp_head::execute() modified: pass constant value STACK_MIN_SIZE instead of 8 * STACK_MIN_SIZE as second argument value in call to check_stack_overrun. Added checking for stack overrun at functions sp_lex_keeper::reset_lex_and_exec_core/sp_instr_stmt::execute. sql/sql_parse.cc: check_stack_overrun modified: allocate buffer for error message at heap instead of stack. parse_sql modified: added call to check_stack_overrun() before parsing of sql statement.
Diffstat (limited to 'sql/sp.cc')
-rw-r--r--sql/sp.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/sp.cc b/sql/sp.cc
index 87eb40c29ac..7385a6ffcae 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -779,6 +779,9 @@ db_load_routine(THD *thd, int type, sp_name *name, sp_head **sphp,
int ret= 0;
+ if (check_stack_overrun(thd, STACK_MIN_SIZE, (uchar*)&ret))
+ return TRUE;
+
thd->lex= &newlex;
newlex.current_select= NULL;
@@ -1505,6 +1508,9 @@ sp_find_routine(THD *thd, int type, sp_name *name, sp_cache **cp,
(int) name->m_name.length, name->m_name.str,
type, cache_only));
+ if (check_stack_overrun(thd, STACK_MIN_SIZE, (uchar*)&depth))
+ return NULL;
+
if ((sp= sp_cache_lookup(cp, name)))
{
ulong level;