summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2016-05-16 20:19:48 -0700
committerIgor Babaev <igor@askmonty.org>2016-05-16 20:19:48 -0700
commita742f8e06b3fca1360477854b4dfad8eaeb387ad (patch)
treedbda4e911312957d72e720d33a5ddc179cefef02
parent4a8d3771718b6bdce4604fa310bd968ca38eb7a2 (diff)
parent1f4f7293fc8af793c16ffac04d78e00950d81903 (diff)
downloadmariadb-git-a742f8e06b3fca1360477854b4dfad8eaeb387ad.tar.gz
Merge branch '10.2' of github.com:MariaDB/server into 10.2
-rw-r--r--sql/sql_yacc.yy29
1 files changed, 19 insertions, 10 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 31158df95ac..c1f9e4d8e0f 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -1919,7 +1919,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%type <variable> internal_variable_name
%type <select_lex> subselect
- get_select_lex query_term
+ get_select_lex
query_expression_body
%type <boolfunc2creator> comp_op
@@ -16378,24 +16378,33 @@ union_option:
| ALL { $$=0; }
;
+/*
+ Corresponds to the SQL Standard
+ <query specification> ::=
+ SELECT [ <set quantifier> ] <select list> <table expression>
+
+ Notes:
+ - We allow more options in addition to <set quantifier>
+ - <table expression> is optional in MariaDB
+*/
+query_specification:
+ SELECT_SYM select_init2_derived opt_table_expression
+ ;
+
query_term:
- SELECT_SYM select_init2_derived
- opt_table_expression
+ query_specification
opt_order_clause
opt_limit_clause
opt_select_lock_type
- {
- $$= Lex->current_select->master_unit()->first_select();
- }
| '(' select_paren_derived ')'
opt_union_order_or_limit
- {
- $$= Lex->current_select->master_unit()->first_select();
- }
;
query_expression_body:
query_term
+ {
+ $$= Lex->current_select->master_unit()->first_select();
+ }
| query_expression_body union_head_non_top query_term
{
Lex->pop_context();
@@ -16407,7 +16416,7 @@ query_expression_body:
subselect:
subselect_start opt_with_clause query_expression_body subselect_end
{
- $3->set_with_clause($2);
+ $3->set_with_clause($2);
$$= $3;
}
;