1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Reset thd->lex->current_select for SP

current_select may point to data from old parser states
when calling a stored procedure with CALL

The failure happens in Item::Item when testing if we are
in having.

Fixed by explicitely reseting current_select in do_execute_sp()
and in sp_rcontext::create(). The later is also needed for
stored functions().
This commit is contained in:
Monty
2018-01-21 20:16:22 +02:00
parent f67b8273c0
commit 6b7dcefdc8
2 changed files with 13 additions and 1 deletions

View File

@ -2876,6 +2876,12 @@ static bool do_execute_sp(THD *thd, sp_head *sp)
ha_rows select_limit= thd->variables.select_limit;
thd->variables.select_limit= HA_POS_ERROR;
/*
Reset current_select as it may point to random data as a
result of previous parsing.
*/
thd->lex->current_select= NULL;
/*
We never write CALL statements into binlog:
- If the mode is non-prelocked, each statement will be logged