diff options
author | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2010-06-11 17:48:24 +0400 |
---|---|---|
committer | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2010-06-11 17:48:24 +0400 |
commit | f84b3f5c21c62ebe3b489250a09aca0ffde1313c (patch) | |
tree | bad36a3866fc1f57ed09d6de5a590fa2e12bacfe /sql/sp.cc | |
parent | 26a034959299cb72d04d92ab330dfb83ef6082a6 (diff) | |
parent | e5cf56ef80391caca2f06b34fc1de1313196e91f (diff) | |
download | mariadb-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.cc | 9 |
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; |