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
commiteae3b4fe762965789badce7b2d6aa51b7f0c317a (patch)
treebad36a3866fc1f57ed09d6de5a590fa2e12bacfe /sql/sp.cc
parent6d38a625c158cb56b33d14496f353652d61f0f2d (diff)
parentb497e2c6b2155bfdc4fc63b0f80eba9a5062a02e (diff)
downloadmariadb-git-eae3b4fe762965789badce7b2d6aa51b7f0c317a.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;