summaryrefslogtreecommitdiff
path: root/sql/sp.cc
diff options
context:
space:
mode:
authorAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-06-11 17:48:24 +0400
committerAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-06-11 17:48:24 +0400
commitf84b3f5c21c62ebe3b489250a09aca0ffde1313c (patch)
treebad36a3866fc1f57ed09d6de5a590fa2e12bacfe /sql/sp.cc
parent26a034959299cb72d04d92ab330dfb83ef6082a6 (diff)
parente5cf56ef80391caca2f06b34fc1de1313196e91f (diff)
downloadmariadb-git-f84b3f5c21c62ebe3b489250a09aca0ffde1313c.tar.gz
Manual merge from mysql-5.1-bugteam to mysql-trunk-merge.
conflicts: conflict mysys/safemalloc.c conflict sql/mysqld.cc conflict sql/sp.cc conflict sql/sql_lex.cc conflict sql/sql_lex.h conflict sql/sql_parse.cc conflict sql/sql_prepare.cc
Diffstat (limited to 'sql/sp.cc')
-rw-r--r--sql/sp.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/sql/sp.cc b/sql/sp.cc
index 57209c918cf..5328471f4c0 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -720,11 +720,18 @@ static sp_head *sp_compile(THD *thd, String *defstr, ulong sql_mode,
ha_rows old_select_limit= thd->variables.select_limit;
sp_rcontext *old_spcont= thd->spcont;
Silence_deprecated_warning warning_handler;
+ Parser_state parser_state;
thd->variables.sql_mode= sql_mode;
thd->variables.select_limit= HA_POS_ERROR;
- Parser_state parser_state(thd, defstr->c_ptr(), defstr->length());
+ if (parser_state.init(thd, defstr->c_ptr(), defstr->length()))
+ {
+ thd->variables.sql_mode= old_sql_mode;
+ thd->variables.select_limit= old_select_limit;
+ return NULL;
+ }
+
lex_start(thd);
thd->push_internal_handler(&warning_handler);
thd->spcont= 0;