summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-06-11 16:52:06 +0400
committerAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-06-11 16:52:06 +0400
commit386929d3aee738cd0e3db335fb54e95bba8f9985 (patch)
treedd79682febb582afa1309c3b04f172d140b20aa6 /sql/sql_parse.cc
parent0823afc8bf160e03ce722c5e3cef21024b63b99a (diff)
parentc2ebb0ac882feadedd0bbca71277fd2de66aa957 (diff)
downloadmariadb-git-386929d3aee738cd0e3db335fb54e95bba8f9985.tar.gz
Manual merge from the bugfix tree.
conflicts: conflict sql/sql_parse.cc
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc30
1 files changed, 19 insertions, 11 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index c4963914036..c4d4f2c9d9d 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -5966,10 +5966,15 @@ void mysql_parse(THD *thd, const char *inBuf, uint length,
sp_cache_flush_obsolete(&thd->sp_proc_cache);
sp_cache_flush_obsolete(&thd->sp_func_cache);
- Parser_state parser_state(thd, inBuf, length);
-
- bool err= parse_sql(thd, & parser_state, NULL);
- *found_semicolon= parser_state.m_lip.found_semicolon;
+ Parser_state parser_state;
+ bool err;
+ if (!(err= parser_state.init(thd, inBuf, length)))
+ {
+ err= parse_sql(thd, & parser_state, NULL);
+ *found_semicolon= parser_state.m_lip.found_semicolon;
+ }
+ else
+ *found_semicolon= NULL;
if (!err)
{
@@ -6055,14 +6060,17 @@ bool mysql_test_parse_for_slave(THD *thd, char *inBuf, uint length)
bool error= 0;
DBUG_ENTER("mysql_test_parse_for_slave");
- Parser_state parser_state(thd, inBuf, length);
- lex_start(thd);
- mysql_reset_thd_for_next_command(thd);
+ Parser_state parser_state;
+ if (!(error= parser_state.init(thd, inBuf, length)))
+ {
+ lex_start(thd);
+ mysql_reset_thd_for_next_command(thd);
- if (!parse_sql(thd, & parser_state, NULL) &&
- all_tables_not_ok(thd, lex->select_lex.table_list.first))
- error= 1; /* Ignore question */
- thd->end_statement();
+ if (!parse_sql(thd, & parser_state, NULL) &&
+ all_tables_not_ok(thd, lex->select_lex.table_list.first))
+ error= 1; /* Ignore question */
+ thd->end_statement();
+ }
thd->cleanup_after_query();
DBUG_RETURN(error);
}