Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance Improvement of create login in BBF #507

Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/backend/utils/adt/acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -5076,7 +5076,19 @@ roles_is_member_of(Oid roleid, enum RoleRecurseType type,
*/
if (otherid == admin_of && form->admin_option &&
OidIsValid(admin_of) && !OidIsValid(*admin_role))
*admin_role = memberid;
{
*admin_role = memberid;

/*
* Need not to iterate through all the members
* if roleid is bbf_role_admin and admin_role is found.
*/
if (sql_dialect == SQL_DIALECT_TSQL &&
get_bbf_admin_oid_hook && roleid == (*get_bbf_admin_oid_hook)())
{
return NULL;
}
}
anju15bharti marked this conversation as resolved.
Show resolved Hide resolved

/* If we're supposed to ignore non-heritable grants, do so. */
if (type == ROLERECURSE_PRIVS && !form->inherit_option)
Expand Down
Loading