From efaaeecaa82710f51516f255105ee973f820f9b9 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 14 Jun 2007 18:35:59 +0400 Subject: 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(). --- sql/sql_trigger.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sql/sql_trigger.cc') diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index f63fcab04bb..ded3a0a6e24 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -981,12 +981,10 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db, thd->variables.sql_mode= (ulong)*trg_sql_mode; Lex_input_stream lip(thd, trg_create_str->str, trg_create_str->length); - thd->m_lip= &lip; lex_start(thd); thd->spcont= 0; - int err= MYSQLparse((void *)thd); - if (err || thd->is_fatal_error) + if (parse_sql(thd, &lip)) { /* Currently sphead is always deleted in case of a parse error */ DBUG_ASSERT(lex.sphead == 0); -- cgit v1.2.1