diff options
author | Igor Babaev <igor@askmonty.org> | 2017-02-04 21:51:40 -0800 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2017-02-04 21:51:40 -0800 |
commit | e51b015fc354ec40c8430d4f4ea6346bc9a8e07b (patch) | |
tree | 8412b7097f231955745cffbbcca36c4f555f15cc /sql/sql_window.cc | |
parent | 20aae56efa5aba90893e602ea87af2f14d161b10 (diff) | |
download | mariadb-git-e51b015fc354ec40c8430d4f4ea6346bc9a8e07b.tar.gz |
Fixed bug mdev-11138.
Supported usage of expressions with window functions
in SELECTs without tables.
Diffstat (limited to 'sql/sql_window.cc')
-rw-r--r-- | sql/sql_window.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/sql_window.cc b/sql/sql_window.cc index f49cc945504..e9e531714f6 100644 --- a/sql/sql_window.cc +++ b/sql/sql_window.cc @@ -2801,6 +2801,11 @@ bool Window_funcs_sort::setup(THD *thd, SQL_SELECT *sel, sort_order= order; } filesort= new (thd->mem_root) Filesort(sort_order, HA_POS_ERROR, true, NULL); + if (!join_tab->join->top_join_tab_count) + { + filesort->tracker= + new (thd->mem_root) Filesort_tracker(thd->lex->analyze_stmt); + } /* Apply the same condition that the subsequent sort has. */ filesort->select= sel; |