summaryrefslogtreecommitdiff
path: root/sql/sql_prepare.cc
diff options
context:
space:
mode:
authorunknown <anozdrin/alik@ibm.>2007-06-14 18:35:59 +0400
committerunknown <anozdrin/alik@ibm.>2007-06-14 18:35:59 +0400
commitefaaeecaa82710f51516f255105ee973f820f9b9 (patch)
tree5df007e2bd85f5bc10349ac41c610c1d6a36654d /sql/sql_prepare.cc
parente615aaff689d0ba939f4b253f4b1ba92eb04d275 (diff)
downloadmariadb-git-efaaeecaa82710f51516f255105ee973f820f9b9.tar.gz
The second cleanup patch in scope of BUG#11986.
1. Introduce parse_sql() as a high-level replacement for MYSQLparse(). parse_sql() is responsible to switch and restore "parser context" (THD::m_lip for now). 2. Fix typo in sp.cc: THD::spcont should be reset *before* calling the parser. sql/event_data_objects.cc: Use parse_sql() instead of MYSQLparse(). sql/mysql_priv.h: Introduce parse_sql() instead of auto-generated MYSQLparse. sql/sp.cc: 1. Use parse_sql() instead of MYSQLparse(). 2. THD::spcont should be reset before calling the parser. sql/sql_class.cc: Reset THD::m_lip. sql/sql_parse.cc: 1. Introduce parse_sql() instead of auto-generated MYSQLparse(). 2. Backup, switch and restore THD::m_lip inside parse_sql(). 3. Use parse_sql() instead of MYSQLparse(). sql/sql_partition.cc: Use parse_sql() instead of MYSQLparse(). sql/sql_prepare.cc: Use parse_sql() instead of MYSQLparse(). sql/sql_trigger.cc: Use parse_sql() instead of MYSQLparse(). sql/sql_view.cc: Use parse_sql() instead of MYSQLparse().
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r--sql/sql_prepare.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 716ca08beb1..2031f4b2448 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -2858,12 +2858,11 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
Lex_input_stream lip(thd, thd->query, thd->query_length);
lip.stmt_prepare_mode= TRUE;
- thd->m_lip= &lip;
lex_start(thd);
- int err= MYSQLparse((void *)thd);
- error= err || thd->is_fatal_error ||
- thd->net.report_error || init_param_array(this);
+ error= parse_sql(thd, &lip) ||
+ thd->net.report_error ||
+ init_param_array(this);
/*
While doing context analysis of the query (in check_prepared_statement)