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

Merge bb-10.2-ext into 10.3

This commit is contained in:
Marko Mäkelä
2018-01-04 09:22:59 +02:00
209 changed files with 6868 additions and 1522 deletions

View File

@ -861,6 +861,22 @@ JOIN::prepare(TABLE_LIST *tables_init,
}
}
/*
After setting up window functions, we may have discovered additional
used tables from the PARTITION BY and ORDER BY list. Update all items
that contain window functions.
*/
if (select_lex->have_window_funcs())
{
List_iterator_fast<Item> it(select_lex->item_list);
Item *item;
while ((item= it++))
{
if (item->with_window_func)
item->update_used_tables();
}
}
With_clause *with_clause=select_lex->get_with_clause();
if (with_clause && with_clause->prepare_unreferenced_elements(thd))
DBUG_RETURN(1);