Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharu Goel committed Sep 25, 2024
1 parent 72ee675 commit dc8664d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions contrib/babelfishpg_tsql/src/rolecmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -2772,8 +2772,13 @@ change_object_owner_if_db_owner()
int rc = 0;
Oid role_oid = GetUserId();

/* TSQL specific behavior and do not call if during CREATE EXTENSION */
if (sql_dialect != SQL_DIALECT_TSQL || creating_extension)
/* TSQL specific behavior */
if (sql_dialect != SQL_DIALECT_TSQL)
return;

dbo_id = get_role_oid(get_dbo_role_name(get_cur_db_name()), true);

if (role_oid == dbo_id || dbo_id == InvalidOid || role_oid == get_bbf_role_admin_oid())
return;

rolname = GetUserNameFromId(role_oid, true);
Expand All @@ -2784,11 +2789,6 @@ change_object_owner_if_db_owner()
if (!is_user(role_oid))
return;

dbo_id = get_role_oid(get_dbo_role_name(get_cur_db_name()), true);

if (role_oid == dbo_id || dbo_id == InvalidOid)
return;

if (!is_member_of_role(role_oid, get_role_oid(get_db_owner_name(get_cur_db_name()), true)))
return;

Expand Down

0 comments on commit dc8664d

Please sign in to comment.