summaryrefslogtreecommitdiff
path: root/sql/sql_select.h
diff options
context:
space:
mode:
authorVarun Gupta <varun.gupta@mariadb.com>2020-05-05 20:44:43 +0530
committerVarun Gupta <varun.gupta@mariadb.com>2020-05-25 10:51:21 +0530
commit4a6b28c7b9c5e2f381f5376178785785c7263146 (patch)
treef0263be58bdeff6b150942adb04c59cd6ccb80ee /sql/sql_select.h
parentcf52dd174ecf0e6055f4443be9c1fea8bc37b65e (diff)
downloadmariadb-git-4a6b28c7b9c5e2f381f5376178785785c7263146.tar.gz
MDEV-22461: JOIN::make_aggr_tables_info(): Assertion `select_options & (1ULL << 17)' failed.
A temporary table is needed for window function computation but if only a NAMED WINDOW SPEC is used and there is no window function, then there is no need to create a temporary table as there is no stage to compute WINDOW FUNCTION
Diffstat (limited to 'sql/sql_select.h')
-rw-r--r--sql/sql_select.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/sql_select.h b/sql/sql_select.h
index 0e011c9267a..92da1355be0 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -1636,6 +1636,7 @@ public:
- We are using an ORDER BY or GROUP BY on fields not in the first table
- We are using different ORDER BY and GROUP BY orders
- The user wants us to buffer the result.
+ - We are using WINDOW functions.
When the WITH ROLLUP modifier is present, we cannot skip temporary table
creation for the DISTINCT clause just because there are only const tables.
*/
@@ -1645,7 +1646,8 @@ public:
((select_distinct || !simple_order || !simple_group) ||
(group_list && order) ||
MY_TEST(select_options & OPTION_BUFFER_RESULT))) ||
- (rollup.state != ROLLUP::STATE_NONE && select_distinct));
+ (rollup.state != ROLLUP::STATE_NONE && select_distinct) ||
+ select_lex->have_window_funcs());
}
bool choose_subquery_plan(table_map join_tables);
void get_partial_cost_and_fanout(int end_tab_idx,