| 6468 | *****************************************************************************/ |
| 6469 | |
| 6470 | ulong 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 | /* |
nothing calls this directly
no test coverage detected