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

Commitf0206d9

Browse files
committed
Fix new Object Access hooks test
Commit90efa2f caused some issues with EXEC_BACKEND builds and withforce_parallel_mode = regress setups. For the first issue we no longertest if the module has been preloaded, and in fact we don't preload it,but simply LOAD it in the test script. For the second issue we suppresserror messages emanating from parallel workers.Mark DilgerDiscussion:https://postgr.es/m/7f6d54a1-4024-3b6e-e3ec-26cd394aac9e@dunslane.net
1 parent097786f commitf0206d9

File tree

5 files changed

+4
-14
lines changed

5 files changed

+4
-14
lines changed

‎src/test/modules/test_oat_hooks/Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ OBJS = \
77
PGFILEDESC = "test_oat_hooks - example use of object access hooks"
88

99
REGRESS = test_oat_hooks
10-
REGRESS_OPTS = --temp-config=$(top_srcdir)/src/test/modules/test_oat_hooks/test_oat_hooks.conf
11-
# Disabled because these tests require "shared_preload_libraries=test_oat_hooks",
12-
# which typical installcheck users do not have (e.g. buildfarm clients).
1310
NO_INSTALLCHECK = 1
1411

1512
ifdefUSE_PGXS

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
-- object_access_hook_str. Since the auditing GUC starts out false, we miss the
33
-- initial "attempting" audit message from the ProcessUtility_hook, but we
44
-- should thereafter see the audit messages
5+
LOAD 'test_oat_hooks';
56
SET test_oat_hooks.audit = true;
67
NOTICE: in object_access_hook_str: superuser attempting alter (set) [test_oat_hooks.audit]
78
NOTICE: in object_access_hook_str: superuser finished alter (set) [test_oat_hooks.audit]

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
-- object_access_hook_str. Since the auditing GUC starts out false, we miss the
33
-- initial "attempting" audit message from the ProcessUtility_hook, but we
44
-- should thereafter see the audit messages
5+
LOAD'test_oat_hooks';
56
SETtest_oat_hooks.audit= true;
67

78
-- Create objects for use in the test

‎src/test/modules/test_oat_hooks/test_oat_hooks.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
#include"postgres.h"
1515

16+
#include"access/parallel.h"
1617
#include"catalog/dependency.h"
1718
#include"catalog/objectaccess.h"
1819
#include"catalog/pg_proc.h"
@@ -68,15 +69,6 @@ void_PG_fini(void);
6869
void
6970
_PG_init(void)
7071
{
71-
/*
72-
* We allow to load the Object Access Type test module on single-user-mode
73-
* or shared_preload_libraries settings only.
74-
*/
75-
if (IsUnderPostmaster)
76-
ereport(ERROR,
77-
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
78-
errmsg("test_oat_hooks must be loaded via shared_preload_libraries")));
79-
8072
/*
8173
* test_oat_hooks.deny_set_variable = (on|off)
8274
*/
@@ -200,7 +192,7 @@ _PG_fini(void)
200192
staticvoid
201193
emit_audit_message(constchar*type,constchar*hook,char*action,char*objName)
202194
{
203-
if (REGRESS_audit)
195+
if (REGRESS_audit&& !IsParallelWorker())
204196
{
205197
constchar*who=superuser_arg(GetUserId()) ?"superuser" :"non-superuser";
206198

‎src/test/modules/test_oat_hooks/test_oat_hooks.conf

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp