1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

10.0-base merge (roles)

This commit is contained in:
Sergei Golubchik
2013-10-29 15:08:44 +01:00
248 changed files with 10725 additions and 1899 deletions

View File

@ -1471,14 +1471,18 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch)
DBUG_PRINT("info",("Use database: %s", new_db_file_name.str));
#ifndef NO_EMBEDDED_ACCESS_CHECKS
db_access=
test_all_bits(sctx->master_access, DB_ACLS) ?
DB_ACLS :
acl_get(sctx->host,
sctx->ip,
sctx->priv_user,
new_db_file_name.str,
FALSE) | sctx->master_access;
if (test_all_bits(sctx->master_access, DB_ACLS))
db_access= DB_ACLS;
else
{
db_access= acl_get(sctx->host, sctx->ip, sctx->priv_user,
new_db_file_name.str, FALSE) | sctx->master_access;
if (sctx->priv_role[0])
{
/* include a possible currently set role for access */
db_access|= acl_get("", "", sctx->priv_role, new_db_file_name.str, FALSE);
}
}
if (!force_switch &&
!(db_access & DB_ACLS) &&