mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
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.
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user