summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <cvicentiu@gmail.com>2013-10-17 15:11:29 -0700
committerSergei Golubchik <sergii@pisem.net>2013-10-17 15:11:29 -0700
commit0254c9a4bd46b58e9fbfa887ae63dd6ce26ccf8f (patch)
tree005f0febb5cb17a6a2538c731a712d2c87b57e19 /sql
parent6062e87f5439e8568cb7efe63bb906a496e425be (diff)
downloadmariadb-git-0254c9a4bd46b58e9fbfa887ae63dd6ce26ccf8f.tar.gz
Added the SET ROLE command to the grammar
Diffstat (limited to 'sql')
-rw-r--r--sql/lex.h1
-rw-r--r--sql/sql_yacc.yy10
2 files changed, 11 insertions, 0 deletions
diff --git a/sql/lex.h b/sql/lex.h
index 003f3175c61..1d577b02879 100644
--- a/sql/lex.h
+++ b/sql/lex.h
@@ -489,6 +489,7 @@ static SYMBOL symbols[] = {
{ "REVOKE", SYM(REVOKE)},
{ "RIGHT", SYM(RIGHT)},
{ "RLIKE", SYM(REGEXP)}, /* Like in mSQL2 */
+ { "ROLE", SYM(ROLE_SYM)},
{ "ROLLBACK", SYM(ROLLBACK_SYM)},
{ "ROLLUP", SYM(ROLLUP_SYM)},
{ "ROUTINE", SYM(ROUTINE_SYM)},
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 8c393dc47aa..cf2fcbf4109 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -1260,6 +1260,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token RETURN_SYM /* SQL-2003-R */
%token REVOKE /* SQL-2003-R */
%token RIGHT /* SQL-2003-R */
+%token ROLE_SYM
%token ROLLBACK_SYM /* SQL-2003-R */
%token ROLLUP_SYM /* SQL-2003-R */
%token ROUTINE_SYM /* SQL-2003-N */
@@ -1687,6 +1688,8 @@ END_OF_INPUT
%type <is_not_empty> opt_union_order_or_limit
+%type <NONE> ROLE_SYM
+
%%
@@ -13490,6 +13493,7 @@ keyword_sp:
| RESOURCES {}
| RESUME_SYM {}
| RETURNS_SYM {}
+ | ROLE_SYM {}
| ROLLUP_SYM {}
| ROUTINE_SYM {}
| ROWS_SYM {}
@@ -13839,6 +13843,12 @@ option_value:
MYSQL_YYABORT;
lex->var_list.push_back(var);
}
+ | ROLE_SYM ident_or_text
+ {
+ LEX *lex = Lex;
+ set_var_role *var= new set_var_role($2);
+ lex->var_list.push_back(var);
+ }
| PASSWORD equal text_or_password
{
LEX *lex= thd->lex;