Commit fadfe447 authored by Varun Gupta's avatar Varun Gupta

MDEV-12985: syntax added for the percentile_cont and percentile_disc functions

parent 29c4bd9d
......@@ -701,6 +701,7 @@ static SYMBOL symbols[] = {
{ "WHILE", SYM(WHILE_SYM)},
{ "WINDOW", SYM(WINDOW_SYM)},
{ "WITH", SYM(WITH)},
{ "WITHIN", SYM(WITHIN)},
{ "WORK", SYM(WORK_SYM)},
{ "WRAPPER", SYM(WRAPPER_SYM)},
{ "WRITE", SYM(WRITE_SYM)},
......@@ -743,6 +744,8 @@ static SYMBOL sql_functions[] = {
{ "NTILE", SYM(NTILE_SYM)},
{ "POSITION", SYM(POSITION_SYM)},
{ "PERCENT_RANK", SYM(PERCENT_RANK_SYM)},
{ "PERCENTILE_CONT", SYM(PERCENTILE_CONT_SYM)},
{ "PERCENTILE_DISC", SYM(PERCENTILE_DISC_SYM)},
{ "RANK", SYM(RANK_SYM)},
{ "ROW_NUMBER", SYM(ROW_NUMBER_SYM)},
{ "SESSION_USER", SYM(USER_SYM)},
......
......@@ -1328,6 +1328,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token PARTITIONING_SYM
%token PASSWORD_SYM
%token PERCENT_RANK_SYM
%token PERCENTILE_CONT_SYM
%token PERCENTILE_DISC_SYM
%token PERSISTENT_SYM
%token PHASE_SYM
%token PLUGINS_SYM
......@@ -1574,6 +1576,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token WINDOW_SYM
%token WHILE_SYM
%token WITH /* SQL-2003-R */
%token WITHIN
%token WITH_CUBE_SYM /* INTERNAL */
%token WITH_ROLLUP_SYM /* INTERNAL */
%token WORK_SYM /* SQL-2003-N */
......@@ -1733,6 +1736,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
window_func_expr
window_func
simple_window_func
inverse_distribution_function
function_call_keyword
function_call_nonkeyword
function_call_generic
......@@ -1951,7 +1955,6 @@ END_OF_INPUT
%type <spvar_definition> row_field_name row_field_definition
%type <spvar_definition_list> row_field_definition_list row_type_body
%type <NONE> opt_window_clause window_def_list window_def window_spec
%type <lex_str_ptr> window_name
%type <NONE> opt_window_ref opt_window_frame_clause
......@@ -9374,6 +9377,7 @@ column_default_non_parenthesized_expr:
| variable
| sum_expr
| window_func_expr
| inverse_distribution_function
| ROW_SYM '(' expr ',' expr_list ')'
{
$5->push_front($3, thd->mem_root);
......@@ -10693,6 +10697,25 @@ simple_window_func:
}
;
inverse_distribution_function:
inverse_distribution_function_type '(' expr ')' WITHIN GROUP_SYM
'(' order_by_single_element_list ')' OVER_SYM '(' opt_window_ref opt_window_partition_clause ')'
{
my_yyabort_error((ER_VIEW_SELECT_VARIABLE, MYF(0)));
};
inverse_distribution_function_type:
PERCENTILE_CONT_SYM
{}
|PERCENTILE_DISC_SYM
{}
;
order_by_single_element_list:
ORDER_SYM BY order_ident order_dir
;
window_name:
ident
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment