MCPcopy Create free account
hub / github.com/Tencent/phxsql / get_table_grant

Function get_table_grant

phx_percona/percona/sql/sql_acl.cc:6470–6491  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6468*****************************************************************************/
6469
6470ulong get_table_grant(THD *thd, TABLE_LIST *table)
6471{
6472 ulong privilege;
6473 Security_context *sctx= thd->security_ctx;
6474 const char *db = table->db ? table->db : thd->db;
6475 GRANT_TABLE *grant_table;
6476
6477 mysql_rwlock_rdlock(&LOCK_grant);
6478#ifdef EMBEDDED_LIBRARY
6479 grant_table= NULL;
6480#else
6481 grant_table= table_hash_search(sctx->get_host()->ptr(), sctx->get_ip()->ptr(),
6482 db, sctx->priv_user, table->table_name, 0);
6483#endif
6484 table->grant.grant_table=grant_table; // Remember for column test
6485 table->grant.version=grant_version;
6486 if (grant_table)
6487 table->grant.privilege|= grant_table->privs;
6488 privilege= table->grant.privilege;
6489 mysql_rwlock_unlock(&LOCK_grant);
6490 return privilege;
6491}
6492
6493
6494/*

Callers

nothing calls this directly

Calls 2

table_hash_searchFunction · 0.85
get_hostMethod · 0.80

Tested by

no test coverage detected