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

MDEV-16353 Server crash on query with CTE

This bug caused crashes for queries with unreferenced non-recursive
CTEs specified by unions.It happened because the function
st_select_lex_unit::prepare() tried to use the value of the field 'derived'
that could not be set for unferenced CTEs as there was no derived
table associated with an unreferenced CTE.
This commit is contained in:
Igor Babaev
2018-05-31 18:55:07 -07:00
parent a31e99a89c
commit b2f86ebdd2
3 changed files with 35 additions and 1 deletions

View File

@ -625,7 +625,7 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
{
if (with_element)
{
if (derived->with->rename_columns_of_derived_unit(thd, this))
if (with_element->rename_columns_of_derived_unit(thd, this))
goto err;
if (check_duplicate_names(thd, sl->item_list, 0))
goto err;