diff options
-rw-r--r-- | sql/set_var.cc | 19 | ||||
-rw-r--r-- | sql/set_var.h | 11 |
2 files changed, 30 insertions, 0 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc index 4473ed54c46..d09e2bcac77 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -872,6 +872,25 @@ int set_var_password::update(THD *thd) } /***************************************************************************** + Functions to handle SET ROLE +*****************************************************************************/ +int set_var_role::check(THD *thd) +{ + /* nothing to check */ + return 0; +} + +int set_var_role::update(THD *thd) +{ +#ifndef NO_EMBEDDED_ACCESS_CHECKS + return acl_setrole(thd, this->role.str); +#else + return 0; +#endif +} + + +/***************************************************************************** Functions to handle SET NAMES and SET CHARACTER SET *****************************************************************************/ diff --git a/sql/set_var.h b/sql/set_var.h index f248dc2894f..75090d6e1da 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -276,6 +276,17 @@ public: int update(THD *thd); }; +/* For SET ROLE */ + +class set_var_role: public set_var_base +{ + LEX_STRING role; +public: + set_var_role(LEX_STRING role_arg) : role(role_arg) {}; + int check(THD *thd); + int update(THD *thd); +}; + /* For SET NAMES and SET CHARACTER SET */ |