diff options
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r-- | sql/sql_prepare.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 31a6c7af04a..ca1b29ea57d 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -2850,10 +2850,14 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len) old_stmt_arena= thd->stmt_arena; thd->stmt_arena= this; - lex_start(thd, thd->query, thd->query_length); + + Lex_input_stream lip(thd, thd->query, thd->query_length); + thd->m_lip= &lip; + lex_start(thd); lex->stmt_prepare_mode= TRUE; + int err= MYSQLparse((void *)thd); - error= MYSQLparse((void *)thd) || thd->is_fatal_error || + error= err || thd->is_fatal_error || thd->net.report_error || init_param_array(this); /* |