@@ -281,8 +281,8 @@ class ACL_ROLE :public ACL_USER_BASE
281281 uint counter;
282282 DYNAMIC_ARRAY parent_grantee; // array of backlinks to elements granted
283283
284- ACL_ROLE (ACL_USER * user, MEM_ROOT *mem );
285- ACL_ROLE (const char * rolename, privilege_t privileges, MEM_ROOT *mem);
284+ ACL_ROLE (ACL_USER *user);
285+ ACL_ROLE (const char *rolename, privilege_t privileges, MEM_ROOT *mem);
286286
287287};
288288
@@ -2182,7 +2182,7 @@ enum enum_acl_lists
21822182 ROLES_MAPPINGS_HASH
21832183};
21842184
2185- ACL_ROLE::ACL_ROLE (ACL_USER *user, MEM_ROOT *root )
2185+ ACL_ROLE::ACL_ROLE (ACL_USER *user)
21862186 :
21872187 /* set initial role access the same as the table row privileges */
21882188 initial_role_access(user->access),
@@ -2194,9 +2194,8 @@ ACL_ROLE::ACL_ROLE(ACL_USER *user, MEM_ROOT *root)
21942194 flags= IS_ROLE;
21952195}
21962196
2197- ACL_ROLE::ACL_ROLE (const char * rolename, privilege_t privileges,
2198- MEM_ROOT *root) :
2199- initial_role_access(privileges), counter(0 )
2197+ ACL_ROLE::ACL_ROLE (const char *rolename, privilege_t privileges, MEM_ROOT *root)
2198+ : initial_role_access(privileges), counter(0 )
22002199{
22012200 this ->access = initial_role_access;
22022201 this ->user .str = safe_strdup_root (root, rolename);
@@ -2666,7 +2665,7 @@ static bool acl_load(THD *thd, const Grant_tables& tables)
26662665 continue ;
26672666 }
26682667
2669- ACL_ROLE *entry= new (&acl_memroot) ACL_ROLE (&user, &acl_memroot );
2668+ ACL_ROLE *entry= new (&acl_memroot) ACL_ROLE (&user);
26702669 entry->role_grants = user.role_grants ;
26712670 my_init_dynamic_array (key_memory_acl_mem, &entry->parent_grantee ,
26722671 sizeof (ACL_USER_BASE *), 0 , 8 , MYF (0 ));
@@ -8518,16 +8517,13 @@ void GRANT_INFO::read(const Security_context *sctx,
85188517 grant_table_user= grant_table_role= grant_public= NULL ;
85198518#else
85208519 grant_table_user=
8521- table_hash_search (sctx->host , sctx->ip , db,
8522- sctx->priv_user ,
8520+ table_hash_search (sctx->host , sctx->ip , db, sctx->priv_user ,
85238521 table, FALSE ); /* purecov: inspected */
85248522 grant_table_role=
8525- sctx->priv_role [0 ] ? table_hash_search (" " , NULL , db,
8526- sctx->priv_role ,
8523+ sctx->priv_role [0 ] ? table_hash_search (" " , NULL , db, sctx->priv_role ,
85278524 table, TRUE ) : NULL ;
85288525 grant_public=
8529- acl_public ? table_hash_search (" " , NULL , db,
8530- public_name.str ,
8526+ acl_public ? table_hash_search (" " , NULL , db, public_name.str ,
85318527 table, TRUE ) : NULL ;
85328528#endif
85338529 version= grant_version;/* purecov: inspected */
@@ -11211,8 +11207,7 @@ bool mysql_drop_user(THD *thd, List <LEX_USER> &list, bool handle_as_role)
1121111207 int rc;
1121211208 user_name= get_current_user (thd, tmp_user_name, false );
1121311209 if (!user_name || (handle_as_role &&
11214- (strcasecmp (user_name->user .str ,
11215- public_name.str ) == 0 )))
11210+ (strcasecmp (user_name->user .str , public_name.str ) == 0 )))
1121611211 {
1121711212 thd->clear_error ();
1121811213 if (!user_name)
@@ -13010,8 +13005,7 @@ LEX_USER *get_current_user(THD *thd, LEX_USER *user, bool lock)
1301013005 return dup;
1301113006 }
1301213007
13013- role_name_check_result result= check_role_name (user->user .str ,
13014- user->host .length == 0 );
13008+ role_name_check_result result= check_role_name (user->user .str , true );
1301513009 if (result == ROLE_NAME_INVALID)
1301613010 return 0 ;
1301713011 if (result == ROLE_NAME_PUBLIC)
0 commit comments