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

Commitda34731

Browse files
committed
Install kludges to fix check-world for src/test/modules
check-world failed in a completely clean tree, because src/test/modulesfail to build unless errcodes.h is generated first. To fix this,install a dependency in src/test/modules' Makefile so that the necessaryfile is generated. Even with this, running "make check" withinindividual module subdirs will still fail because the dependency is notconsidered there, but this case is less interesting and would be messierto fix.check-world still failed with the above fix in place, this time becausedummy_seclabel used LOAD to load the dynamic library, which doesn't workbecause the @libdir@ (expanded by the makefile) is expanded to the finalinstall path, not the temporary installation directory used by makecheck. To fix, tweak things so that CREATE EXTENSION can be usedinstead, which solves the problem because the library path is expandedby the backend, which is aware of the true libdir.
1 parent475aedd commitda34731

File tree

9 files changed

+35
-4
lines changed

9 files changed

+35
-4
lines changed

‎src/test/modules/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,9 @@ SUBDIRS = \
1010
test_shm_mq\
1111
test_parser
1212

13+
all: submake-errcodes
14+
15+
submake-errcodes:
16+
$(MAKE) -C$(top_builddir)/src/backend submake-errcodes
17+
1318
$(recurse)

‎src/test/modules/dummy_seclabel/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
MODULES = dummy_seclabel
44
PGFILEDESC = "dummy_seclabel - regression testing of the SECURITY LABEL statement"
55

6+
EXTENSION = dummy_seclabel
7+
DATA = dummy_seclabel--1.0.sql
8+
69
REGRESS = dummy_seclabel
710
EXTRA_CLEAN = sql/dummy_seclabel.sql expected/dummy_seclabel.out
811

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* src/test/modules/dummy_seclabel/dummy_seclabel--1.0.sql*/
2+
3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use"CREATE EXTENSION dummy_seclabel" to load this file. \quit
5+
6+
CREATEFUNCTIONdummy_seclabel_dummy()
7+
RETURNSpg_catalog.void
8+
AS'MODULE_PATHNAME' LANGUAGE C;
9+

‎src/test/modules/dummy_seclabel/dummy_seclabel.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ PG_MODULE_MAGIC;
2121
/* Entrypoint of the module */
2222
void_PG_init(void);
2323

24+
PG_FUNCTION_INFO_V1(dummy_seclabel_dummy);
25+
2426
staticvoid
2527
dummy_object_relabel(constObjectAddress*object,constchar*seclabel)
2628
{
@@ -48,3 +50,13 @@ _PG_init(void)
4850
{
4951
register_label_provider("dummy",dummy_object_relabel);
5052
}
53+
54+
/*
55+
* This function is here just so that the extension is not completely empty
56+
* and the dynamic library is loaded when CREATE EXTENSION runs.
57+
*/
58+
Datum
59+
dummy_seclabel_dummy(PG_FUNCTION_ARGS)
60+
{
61+
PG_RETURN_VOID();
62+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
comment = 'Test code for SECURITY LABEL feature'
2+
default_version = '1.0'
3+
module_pathname = '$libdir/dummy_seclabel'
4+
relocatable = true

‎src/test/modules/dummy_seclabel/expected/.gitignore

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

‎src/test/modules/dummy_seclabel/output/dummy_seclabel.sourcerenamed to‎src/test/modules/dummy_seclabel/expected/dummy_seclabel.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--
22
-- Test for facilities of security label
33
--
4-
LOAD '@libdir@/dummy_seclabel@DLSUFFIX@';
4+
CREATE EXTENSIONdummy_seclabel;
55
-- initial setups
66
SET client_min_messages TO 'warning';
77
DROP ROLE IF EXISTS dummy_seclabel_user1;

‎src/test/modules/dummy_seclabel/sql/.gitignore

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

‎src/test/modules/dummy_seclabel/input/dummy_seclabel.sourcerenamed to‎src/test/modules/dummy_seclabel/sql/dummy_seclabel.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--
22
-- Test for facilities of security label
33
--
4-
LOAD '@libdir@/dummy_seclabel@DLSUFFIX@';
4+
CREATE EXTENSIONdummy_seclabel;
55

66
-- initial setups
77
SET client_min_messages TO'warning';

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp