Skip to content

Commit 14690c7

Browse files
committed
Enable almost all aggregate functions for window functions
1 parent dfd3be9 commit 14690c7

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

sql/sql_window.cc

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2313,24 +2313,18 @@ bool Window_func_runner::add_function_to_run(Item_window_func *win_func)
23132313
sum_func->setup_window_func(current_thd, win_func->window_spec);
23142314

23152315
Item_sum::Sumfunctype type= win_func->window_func()->sum_func();
2316+
23162317
switch (type)
23172318
{
2318-
case Item_sum::ROW_NUMBER_FUNC:
2319-
case Item_sum::RANK_FUNC:
2320-
case Item_sum::DENSE_RANK_FUNC:
2321-
case Item_sum::COUNT_FUNC:
2322-
case Item_sum::SUM_BIT_FUNC:
2323-
case Item_sum::SUM_FUNC:
2324-
case Item_sum::AVG_FUNC:
2325-
case Item_sum::PERCENT_RANK_FUNC:
2326-
case Item_sum::CUME_DIST_FUNC:
2327-
case Item_sum::NTILE_FUNC:
2328-
break;
2329-
2330-
default:
2319+
/* Distinct is not yet supported. */
2320+
case Item_sum::GROUP_CONCAT_FUNC:
2321+
case Item_sum::SUM_DISTINCT_FUNC:
2322+
case Item_sum::AVG_DISTINCT_FUNC:
23312323
my_error(ER_NOT_SUPPORTED_YET, MYF(0),
23322324
"This aggregate as window function");
23332325
return true;
2326+
default:
2327+
break;
23342328
}
23352329

23362330
return window_functions.push_back(win_func);

0 commit comments

Comments
 (0)