MCPcopy Create free account
hub / github.com/MariaDB/server / fill_schema_enabled_roles

Function fill_schema_enabled_roles

sql/sql_acl.cc:12889–12912  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12887}
12888
12889int fill_schema_enabled_roles(THD *thd, TABLE_LIST *tables, COND *cond)
12890{
12891 TABLE *table= tables->table;
12892#ifndef NO_EMBEDDED_ACCESS_CHECKS
12893 if (thd->security_ctx->priv_role[0])
12894 {
12895 mysql_rwlock_rdlock(&LOCK_grant);
12896 mysql_mutex_lock(&acl_cache->lock);
12897 ACL_ROLE *acl_role= find_acl_role(Lex_cstring_strlen(
12898 thd->security_ctx->priv_role),
12899 false);
12900 if (acl_role)
12901 traverse_role_graph_down(acl_role, table, enabled_roles_insert, NULL);
12902 mysql_mutex_unlock(&acl_cache->lock);
12903 mysql_rwlock_unlock(&LOCK_grant);
12904 if (acl_role)
12905 return 0;
12906 }
12907#endif
12908
12909 restore_record(table, s->default_values);
12910 table->field[0]->set_null();
12911 return schema_table_store_record(table->in_use, table);
12912}
12913
12914
12915/*

Callers

nothing calls this directly

Calls 5

find_acl_roleFunction · 0.85
Lex_cstring_strlenClass · 0.85
traverse_role_graph_downFunction · 0.85
set_nullMethod · 0.45

Tested by

no test coverage detected