1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-13683: crash in Item_window_func::update_used_tables

Window definitions are resolved during fix fields. Updating used tables
for window functions must be done after all window functions have had a
chance to be resolved.

There was an additional problem with the implementation: expressions that
contained window functions never updated the expression's used tables.
To fix both these issues, make sure to call "update_used_tables" on all
items that contain window functions after we have passed through all
items.
This commit is contained in:
Vicențiu Ciorbaru
2017-12-28 19:29:40 +02:00
parent 8e9d8ffd1a
commit 6c4cf79d94
2 changed files with 16 additions and 7 deletions

View File

@ -297,13 +297,6 @@ setup_windows(THD *thd, Ref_ptr_array ref_pointer_array, TABLE_LIST *tables,
}
}
List_iterator_fast<Item_window_func> li(win_funcs);
Item_window_func *win_func_item;
while ((win_func_item= li++))
{
win_func_item->update_used_tables();
}
DBUG_RETURN(0);
}