Skip to content

Commit 450fa1b

Browse files
committed
Fix installcheck for test_rls_hooks
As pointed out by the buildfarm, test_rls_hooks wasn't functioning properly with a clean installcheck. test_rls_hooks needs to explicitly load the library with the hooks in it, to allow installcheck to work; using the --temp-config doesn't help since that isn't used when running installcheck and it isn't exactly fair to the buildfarm to modify the installed config prior to calling installcheck. Also, have test_rls_hooks clean up after itself.
1 parent 0bf22e0 commit 450fa1b

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/test/modules/test_rls_hooks/expected/test_rls_hooks.out

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
LOAD 'test_rls_hooks';
12
CREATE TABLE rls_test_permissive (
23
username name,
34
supervisor name,
@@ -191,3 +192,9 @@ ERROR: new row violates WITH CHECK OPTION for "rls_test_both"
191192
-- failure
192193
INSERT INTO rls_test_both VALUES ('r4','s4',7);
193194
ERROR: new row violates WITH CHECK OPTION for "rls_test_both"
195+
RESET ROLE;
196+
DROP TABLE rls_test_restrictive;
197+
DROP TABLE rls_test_permissive;
198+
DROP TABLE rls_test_both;
199+
DROP ROLE r1;
200+
DROP ROLE s1;

src/test/modules/test_rls_hooks/sql/test_rls_hooks.sql

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
LOAD 'test_rls_hooks';
2+
13
CREATE TABLE rls_test_permissive (
24
username name,
35
supervisor name,
@@ -155,3 +157,12 @@ INSERT INTO rls_test_both VALUES ('r1','s1',7);
155157

156158
-- failure
157159
INSERT INTO rls_test_both VALUES ('r4','s4',7);
160+
161+
RESET ROLE;
162+
163+
DROP TABLE rls_test_restrictive;
164+
DROP TABLE rls_test_permissive;
165+
DROP TABLE rls_test_both;
166+
167+
DROP ROLE r1;
168+
DROP ROLE s1;

0 commit comments

Comments
 (0)