Fixes test output for pg16

granted_by_propagation_non_filter
gurkanindibay 2024-03-13 14:58:52 +03:00
parent 42a5149ece
commit 9874a074f6
2 changed files with 15 additions and 11 deletions

View File

@ -891,7 +891,8 @@ GenerateGrantRoleStmtsOfRole(Oid roleid)
Form_pg_auth_members membership = (Form_pg_auth_members) GETSTRUCT(tuple);
GrantRoleStmt *grantRoleStmt = GetGrantRoleStmtFromAuthMemberRecord(membership);
if (grantRoleStmt == NULL ||IsReservedName(GetUserNameFromId(membership->roleid, true)))
if (grantRoleStmt == NULL || IsReservedName(GetUserNameFromId(membership->roleid,
true)))
{
continue;
}
@ -938,7 +939,8 @@ GenerateGrantRoleStmts()
GrantRoleStmt *grantRoleStmt = GetGrantRoleStmtFromAuthMemberRecord(membership);
if (grantRoleStmt == NULL || IsReservedName(GetUserNameFromId(membership->roleid, true)))
if (grantRoleStmt == NULL || IsReservedName(GetUserNameFromId(membership->roleid,
true)))
{
continue;
}

View File

@ -1032,14 +1032,14 @@ WHERE roleid::regrole::text = 'role1' ORDER BY 1, 2;
-- Set GUCs to log remote commands and filter on REVOKE commands
SET citus.log_remote_commands TO on;
SET citus.grep_remote_commands = '%REVOKE%';
-- test REVOKES as well
GRANT role1 TO role2;
REVOKE SET OPTION FOR role1 FROM role2;
-- test REVOKES as well
GRANT role1 TO role2;
REVOKE SET OPTION FOR role1 FROM role2;
NOTICE: issuing REVOKE SET OPTION FOR role1 FROM role2 RESTRICT;
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
NOTICE: issuing REVOKE SET OPTION FOR role1 FROM role2 RESTRICT;
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
REVOKE INHERIT OPTION FOR role1 FROM role2;
REVOKE INHERIT OPTION FOR role1 FROM role2;
NOTICE: issuing REVOKE INHERIT OPTION FOR role1 FROM role2 RESTRICT;
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
NOTICE: issuing REVOKE INHERIT OPTION FOR role1 FROM role2 RESTRICT;
@ -1053,14 +1053,16 @@ CREATE ROLE role5;
RESET citus.enable_ddl_propagation;
-- by default, admin option is false, inherit is true, set is true
GRANT role3 TO role4;
ERROR: role "role4" does not exist
CONTEXT: while executing command on localhost:xxxxx
GRANT role3 TO role5 WITH ADMIN TRUE, INHERIT FALSE, SET FALSE;
ERROR: role "role5" does not exist
CONTEXT: while executing command on localhost:xxxxx
SELECT roleid::regrole::text AS role, member::regrole::text, admin_option, inherit_option, set_option FROM pg_auth_members
WHERE roleid::regrole::text = 'role3' ORDER BY 1, 2;
role | member | admin_option | inherit_option | set_option
role | member | admin_option | inherit_option | set_option
---------------------------------------------------------------------
role3 | role4 | f | t | t
role3 | role5 | t | f | f
(2 rows)
(0 rows)
DROP ROLE role3, role4, role5;
-- Test that everything works fine for roles that are propagated
@ -1140,7 +1142,7 @@ DROP ROLE role6, role7, role8, role9, role10, role11, role12,
-- when adding a new node.
-- First, we need to remove the node:
SELECT 1 FROM citus_remove_node('localhost', :worker_2_port);
?column?
?column?
---------------------------------------------------------------------
1
(1 row)