summaryrefslogtreecommitdiff
path: root/sql/sql_parse.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/sql_parse.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/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc30
1 files changed, 21 insertions, 9 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 77d7fefb1b5..bdee13372d5 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -559,7 +559,14 @@ static void handle_bootstrap_impl(THD *thd)
mode we have only one thread.
*/
thd->set_time();
- Parser_state parser_state(thd, thd->query(), length);
+ Parser_state parser_state;
+ if (parser_state.init(thd, thd->query(), length))
+ {
+ thd->protocol->end_statement();
+ bootstrap_error= 1;
+ break;
+ }
+
mysql_parse(thd, thd->query(), length, &parser_state);
close_thread_tables(thd); // Free tables
@@ -1121,7 +1128,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
#if defined(ENABLED_PROFILING)
thd->profiling.set_query_source(thd->query(), thd->query_length());
#endif
- Parser_state parser_state(thd, thd->query(), thd->query_length());
+ Parser_state parser_state;
+ if (parser_state.init(thd, thd->query(), thd->query_length()))
+ break;
mysql_parse(thd, thd->query(), thd->query_length(), &parser_state);
@@ -5907,14 +5916,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);
}