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

MDEV-15478: Lost name of a explicitly named CTE column used in

the non-recursive CTE defined with UNION

The problem appears as the columns of the non-recursive CTE weren't renamed.
The renaming procedure was called for recursive CTEs only.

To fix it in the procedure st_select_lex_unit::prepare
With_element::rename_columns_of_derived_unit is called now for both CTEs:
recursive and non-recursive.
This commit is contained in:
Galina Shalygina
2018-03-13 02:53:48 +02:00
parent 8c8028ca68
commit d251cedd8d
3 changed files with 61 additions and 1 deletions

View File

@ -598,7 +598,7 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
types= first_sl->item_list;
else if (sl == first_sl)
{
if (is_recursive)
if (with_element)
{
if (derived->with->rename_columns_of_derived_unit(thd, this))
goto err;