summaryrefslogtreecommitdiff
path: root/sql/sql_window.cc
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2017-12-28 19:29:40 +0200
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2017-12-28 20:04:23 +0200
commit6c4cf79d9497c1d9c7e1af9aaf66ac18a08cdebe (patch)
treeee11334cfc4afa8fb394f7ae0a8574c81df46a72 /sql/sql_window.cc
parent8e9d8ffd1a215d4c2bf1cdeb24c112bef2ff58dd (diff)
downloadmariadb-git-6c4cf79d9497c1d9c7e1af9aaf66ac18a08cdebe.tar.gz
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.
Diffstat (limited to 'sql/sql_window.cc')
-rw-r--r--sql/sql_window.cc7
1 files changed, 0 insertions, 7 deletions
diff --git a/sql/sql_window.cc b/sql/sql_window.cc
index 7ae967d7077..4e1e64365ae 100644
--- a/sql/sql_window.cc
+++ b/sql/sql_window.cc
@@ -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);
}