diff options
author | Igor Babaev <igor@askmonty.org> | 2017-02-10 17:20:46 -0800 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2017-02-10 17:21:45 -0800 |
commit | 559345806216369bad999539018bd3943860a5d5 (patch) | |
tree | cf8caa0141441b493888b639908587a4f184803b /sql/sql_select.cc | |
parent | 1b4f694adfa257d41b5ddb141e5bcc23e6dfd9c8 (diff) | |
download | mariadb-git-559345806216369bad999539018bd3943860a5d5.tar.gz |
Fixed bug mdev-12015.
Corrected an assertion in JOIN::create_postjoin_aggr_table():
JOIN::join_tab[0] can be the first aggregation table if
the query uses window functions.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 865d852d371..38752a153b5 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -2779,8 +2779,8 @@ JOIN::create_postjoin_aggr_table(JOIN_TAB *tab, List<Item> *table_fields, tmp_table_param.using_outer_summary_function= tab->tmp_table_param->using_outer_summary_function; tab->join= this; - DBUG_ASSERT(tab > tab->join->join_tab || !tables_list); - if (tables_list) + DBUG_ASSERT(tab > join_tab || select_lex->have_window_funcs()); + if (tab > join_tab) (tab - 1)->next_select= sub_select_postjoin_aggr; tab->aggr= new (thd->mem_root) AGGR_OP(tab); if (!tab->aggr) |