Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
a607e4e7
Commit
a607e4e7
authored
Oct 28, 2017
by
Varun Gupta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the syntax for percentile functions and median function to the sql_yacc_ora.yy file
parent
ab5503c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
7 deletions
+29
-7
sql/sql_yacc_ora.yy
sql/sql_yacc_ora.yy
+29
-7
No files found.
sql/sql_yacc_ora.yy
View file @
a607e4e7
...
...
@@ -645,6 +645,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token MAX_STATEMENT_TIME_SYM
%token MAX_USER_CONNECTIONS_SYM
%token MAXVALUE_SYM /* SQL-2003-N */
%token MEDIAN_SYM
%token MEDIUMBLOB
%token MEDIUMINT
%token MEDIUMTEXT
...
...
@@ -1151,6 +1152,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
window_func
simple_window_func
inverse_distribution_function
percentile_function
inverse_distribution_function_def
explicit_cursor_attr
function_call_keyword
...
...
@@ -10723,13 +10725,9 @@ simple_window_func:
MYSQL_YYABORT;
}
;
inverse_distribution_function:
inverse_distribution_function_def WITHIN GROUP_SYM
'('
{ Select->prepare_add_window_spec(thd); }
order_by_single_element_list ')' OVER_SYM
'(' opt_window_ref opt_window_partition_clause ')'
percentile_function OVER_SYM
'(' opt_window_partition_clause ')'
{
LEX *lex= Lex;
if (Select->add_window_spec(thd, lex->win_ref,
...
...
@@ -10746,6 +10744,29 @@ inverse_distribution_function:
}
;
percentile_function:
inverse_distribution_function_def WITHIN GROUP_SYM '('
{ Select->prepare_add_window_spec(thd); }
order_by_single_element_list ')'
{
$$= $1;
}
| MEDIAN_SYM '(' expr ')'
{
Item *args= new (thd->mem_root) Item_decimal(thd, "0.5", 3,
thd->charset());
if (($$ == NULL) || (thd->is_error()))
{
MYSQL_YYABORT;
}
if (add_order_to_list(thd, $3,FALSE)) MYSQL_YYABORT;
$$= new (thd->mem_root) Item_sum_percentile_cont(thd, args);
if ($$ == NULL)
MYSQL_YYABORT;
}
;
inverse_distribution_function_def:
PERCENTILE_CONT_SYM '(' expr ')'
{
...
...
@@ -10762,7 +10783,8 @@ inverse_distribution_function_def:
;
order_by_single_element_list:
ORDER_SYM BY order_list
ORDER_SYM BY order_ident order_dir
{ if (add_order_to_list(thd, $3,(bool) $4)) MYSQL_YYABORT; }
;
window_name:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment