Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit03b87d0

Browse files
committed
Fix two portability issues with the tests of test_oat_hooks
This addresses two issues in the tests of test_oat_hooks:- The role regress_test_user was being left behind, preventing the testto succeed on repeated runs. It makes sense to leave some objectsbehind to have more coverage for pg_upgrade (as does test_pg_dump), butthe role dropped here does not own any objects so there is no reason tokeep it.- GRANT SET ON PARAMETER is issued, creating an entry inpg_parameter_acl without cleaning up the entry created. This causesan overlap with unsafe_tests as both use work_mem, making the latterfail. This commit adds an extra REVOKE SET ON PARAMETER to clean thecontents of pg_parameter_acl, switching to maintenance_work_mem ratherthan work_mem to avoid an overlap between both tests.The tests of test_oat_hooks cannot use installcheck yet as these areproving to be unstable with caching and the namespace search hooks, sothe issues fixed here cannot be reached yet, but they would be once thehook issue is addressed and installcheck is allowed again intest_oat_hooks.Discussion:https://postgr.es/m/YrpVkADAY0knF6vM@paquier.xyzBackpatch-through: 15
1 parent834fce5 commit03b87d0

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

‎src/test/modules/test_oat_hooks/expected/test_oat_hooks.out

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,13 @@ privileges for parameter test_oat_hooks.super_var2
4141
privileges for parameter none.such
4242
privileges for parameter another.bogus
4343
-- Check the behavior of the hooks relative to do-nothing grants and revokes
44-
GRANT SET ON PARAMETERwork_mem TO PUBLIC;
44+
GRANT SET ON PARAMETERmaintenance_work_mem TO PUBLIC;
4545
NOTICE: in process utility: superuser attempting GrantStmt
4646
NOTICE: in process utility: superuser finished GrantStmt
47-
REVOKE ALTER SYSTEM ON PARAMETER work_mem FROM PUBLIC;
47+
REVOKE SET ON PARAMETER maintenance_work_mem FROM PUBLIC;
48+
NOTICE: in process utility: superuser attempting GrantStmt
49+
NOTICE: in process utility: superuser finished GrantStmt
50+
REVOKE ALTER SYSTEM ON PARAMETER maintenance_work_mem FROM PUBLIC;
4851
NOTICE: in process utility: superuser attempting GrantStmt
4952
NOTICE: in process utility: superuser finished GrantStmt
5053
-- Check the behavior of the hooks relative to unrecognized parameters
@@ -299,3 +302,4 @@ REVOKE ALL PRIVILEGES ON PARAMETER
299302
test_oat_hooks.user_var2, test_oat_hooks.super_var2
300303
FROM regress_role_joe;
301304
DROP ROLE regress_role_joe;
305+
DROP ROLE regress_test_user;

‎src/test/modules/test_oat_hooks/sql/test_oat_hooks.sql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ GRANT SET, ALTER SYSTEM ON PARAMETER another.bogus TO regress_role_joe WITH GRAN
2525
DROP ROLE regress_role_joe;
2626

2727
-- Check the behavior of the hooks relative to do-nothing grants and revokes
28-
GRANTSETON PARAMETER work_mem TO PUBLIC;
29-
REVOKE ALTER SYSTEMON PARAMETER work_memFROM PUBLIC;
28+
GRANTSETON PARAMETER maintenance_work_mem TO PUBLIC;
29+
REVOKESETON PARAMETER maintenance_work_memFROM PUBLIC;
30+
REVOKE ALTER SYSTEMON PARAMETER maintenance_work_memFROM PUBLIC;
3031

3132
-- Check the behavior of the hooks relative to unrecognized parameters
3233
GRANT ALLON PARAMETER"none.such" TO PUBLIC;
@@ -98,3 +99,4 @@ REVOKE ALL PRIVILEGES ON PARAMETER
9899
test_oat_hooks.user_var2,test_oat_hooks.super_var2
99100
FROM regress_role_joe;
100101
DROP ROLE regress_role_joe;
102+
DROP ROLE regress_test_user;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp