diff options
author | Vicentiu Ciorbaru <cvicentiu@gmail.com> | 2014-07-13 23:57:10 +0000 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2014-07-23 14:48:12 +0200 |
commit | 64b27c734eed91e2b79701c9c53283d9411f702f (patch) | |
tree | 6f7e49f44ad916637fb214fc93df1a59bcf76553 /sql/sql_yacc.yy | |
parent | 43351faf2b229fb2e87331227efb2daf554647a7 (diff) | |
download | mariadb-git-64b27c734eed91e2b79701c9c53283d9411f702f.tar.gz |
Added default role implementation
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r-- | sql/sql_yacc.yy | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index db569ad01f7..a261d611aa6 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -14667,10 +14667,39 @@ option_value_no_option_type: MYSQL_YYABORT; lex->var_list.push_back(var); } + | DEFAULT ROLE_SYM grant_role + { + LEX *lex = Lex; + LEX_USER *user; + if (!(user=(LEX_USER *) thd->calloc(sizeof(LEX_USER)))) + MYSQL_YYABORT; + user->user= current_user; + set_var_default_role *var= new set_var_default_role(user, + $3->user); + if (var == NULL) + MYSQL_YYABORT; + lex->var_list.push_back(var); + thd->lex->autocommit= TRUE; + if (lex->sphead) + lex->sphead->m_flags|= sp_head::HAS_SET_AUTOCOMMIT_STMT; + } + | DEFAULT ROLE_SYM grant_role FOR_SYM user + { + LEX *lex = Lex; + set_var_default_role *var= new set_var_default_role($5, $3->user); + if (var == NULL) + MYSQL_YYABORT; + lex->var_list.push_back(var); + thd->lex->autocommit= TRUE; + if (lex->sphead) + lex->sphead->m_flags|= sp_head::HAS_SET_AUTOCOMMIT_STMT; + } | ROLE_SYM ident_or_text { LEX *lex = Lex; set_var_role *var= new set_var_role($2); + if (var == NULL) + MYSQL_YYABORT; lex->var_list.push_back(var); } | PASSWORD equal text_or_password @@ -14710,6 +14739,7 @@ option_value_no_option_type: } ; + internal_variable_name: ident { |