Details
-
Task
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
None
Description
We currently have a patched in MariaDB's parser to support UDAFs. We need to work with the server team to do this in a more generic way.
Current patch used by ColumnStore for UDAF window functions:
@@ -10482,6 +10478,29 @@ window_func:
|
sum_expr
{
+ ((Item_sum *) $1)->mark_as_window_func_sum_expr();
+ }
+ |
+ function_call_generic
+ {
+ /*
+ We want to allow UDF aggregate (UDAF) functions as Window functions.
+ function_call_generic handles UDAF, so we leverage
+ that and then filter out anything that isn't a UDAF.
+ */
+ Item* item = (Item*)$1;
+ if (item == NULL)
+ {
+ my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "FUNCTION", "");
+ MYSQL_YYABORT;
+ }
+ if ((item->type() != Item::SUM_FUNC_ITEM)
+ || (((Item_sum *)item)->sum_func() != Item_sum::UDF_SUM_FUNC))
+ {
+ my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "FUNCTION", ((Item_func_sp*)item)->func_name());
+ MYSQL_YYABORT;
+ }
+
((Item_sum *) $1)->mark_as_window_func_sum_expr();
}
;