Skip to content

Commit a3b071b

Browse files
committed
Tidy up Object Access hooks tests
per gripelet from Tom Lane.
1 parent f0206d9 commit a3b071b

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

src/test/modules/test_oat_hooks/Makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
# src/test/modules/test_oat_hooks/Makefile
22

33
MODULE_big = test_oat_hooks
4-
OBJS = \
5-
$(WIN32RES) \
6-
test_oat_hooks.o
4+
OBJS = test_oat_hooks.o $(WIN32RES)
75
PGFILEDESC = "test_oat_hooks - example use of object access hooks"
86

97
REGRESS = test_oat_hooks
10-
NO_INSTALLCHECK = 1
118

129
ifdef USE_PGXS
1310
PG_CONFIG = pg_config

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ NOTICE: in process utility: superuser attempting set
155155
NOTICE: in object_access_hook_str: superuser attempting alter (set) [test_oat_hooks.deny_utility_commands]
156156
NOTICE: in object_access_hook_str: superuser finished alter (set) [test_oat_hooks.deny_utility_commands]
157157
NOTICE: in process utility: superuser finished set
158-
-- Try again as non-superuser with permisisons denied
158+
-- Try again as non-superuser with permissions denied
159159
SET SESSION AUTHORIZATION regress_test_user;
160160
NOTICE: in process utility: superuser attempting set
161161
NOTICE: in object_access_hook_str: non-superuser attempting alter (set) [session_authorization]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ SET test_oat_hooks.deny_object_access = true;
3939
SET test_oat_hooks.deny_exec_perms = true;
4040
SET test_oat_hooks.deny_utility_commands = true;
4141

42-
-- Try again as non-superuser with permisisons denied
42+
-- Try again as non-superuser with permissions denied
4343
SET SESSION AUTHORIZATION regress_test_user;
4444
SELECT * FROM regress_test_table;
4545
SELECT regress_test_func('arg');

src/test/modules/test_oat_hooks/test_oat_hooks.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,11 @@ _PG_fini(void)
192192
static void
193193
emit_audit_message(const char *type, const char *hook, char *action, char *objName)
194194
{
195+
/*
196+
* Ensure that audit messages are not duplicated by only emitting them from
197+
* a leader process, not a worker process. This makes the test results
198+
* deterministic even if run with force_parallel_mode = regress.
199+
*/
195200
if (REGRESS_audit && !IsParallelWorker())
196201
{
197202
const char *who = superuser_arg(GetUserId()) ? "superuser" : "non-superuser";

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy