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

Commitf161802

Browse files
committed
Fix flag tests in src/test/modules/test_oat_hooks
In what must have been a copy'n paste mistake, all the flag tests usethe same flag rather than a different flag each. The bug is notsuprising, considering that it's dead code; add a minimal, testimonialline to cover it.This is all pretty inconsequential, because this is just example code,but it had better be correct.Discussion:https://postgr.es/m/20220712152059.fwli2majwgzdmh4r@alvherre.pgsql
1 parent784cedd commitf161802

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ NOTICE: in object access: superuser finished create (subId=0x0) [internal]
8383
NOTICE: in object access: superuser attempting create (subId=0x0) [internal]
8484
NOTICE: in object access: superuser finished create (subId=0x0) [internal]
8585
NOTICE: in process utility: superuser finished CreateStmt
86+
CREATE INDEX regress_test_table_t_idx ON regress_test_table (t);
87+
NOTICE: in process utility: superuser attempting IndexStmt
88+
NOTICE: in object access: superuser attempting create (subId=0x0) [explicit]
89+
NOTICE: in object access: superuser finished create (subId=0x0) [explicit]
90+
NOTICE: in process utility: superuser finished IndexStmt
8691
GRANT SELECT ON Table regress_test_table TO public;
8792
NOTICE: in process utility: superuser attempting GrantStmt
8893
NOTICE: in process utility: superuser finished GrantStmt
@@ -280,12 +285,18 @@ NOTICE: in process utility: superuser attempting alter system
280285
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x2000, alter system) [work_mem]
281286
NOTICE: in object_access_hook_str: superuser finished alter (subId=0x2000, alter system) [work_mem]
282287
NOTICE: in process utility: superuser finished alter system
283-
--Clean up
288+
--try labelled drops
284289
RESET SESSION AUTHORIZATION;
285290
NOTICE: in process utility: superuser attempting set
286291
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [session_authorization]
287292
NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [session_authorization]
288293
NOTICE: in process utility: superuser finished set
294+
DROP INDEX CONCURRENTLY regress_test_table_t_idx;
295+
NOTICE: in process utility: superuser attempting DropStmt
296+
NOTICE: in object access: superuser attempting drop (subId=0x0) [concurrent drop,]
297+
NOTICE: in object access: superuser finished drop (subId=0x0) [concurrent drop,]
298+
NOTICE: in process utility: superuser finished DropStmt
299+
-- Clean up
289300
SET test_oat_hooks.audit = false;
290301
NOTICE: in process utility: superuser attempting set
291302
DROP ROLE regress_role_joe; -- fails

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ REVOKE ALL ON PARAMETER "none.such" FROM PUBLIC;
3838
-- Create objects for use in the test
3939
CREATEUSERregress_test_user;
4040
CREATETABLEregress_test_table (ttext);
41+
CREATEINDEXregress_test_table_t_idxON regress_test_table (t);
4142
GRANTSELECTON Table regress_test_table TO public;
4243
CREATEFUNCTIONregress_test_func (ttext) RETURNStextAS $$
4344
SELECT $1;
@@ -88,9 +89,11 @@ RESET work_mem;
8889
ALTER SYSTEMSET work_mem=8192;
8990
ALTER SYSTEM RESET work_mem;
9091

91-
--Clean up
92+
--try labelled drops
9293
RESET SESSION AUTHORIZATION;
94+
DROPINDEX CONCURRENTLY regress_test_table_t_idx;
9395

96+
-- Clean up
9497
SETtest_oat_hooks.audit= false;
9598
DROP ROLE regress_role_joe;-- fails
9699
REVOKE ALL PRIVILEGESON PARAMETER

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1795,15 +1795,15 @@ accesstype_arg_to_string(ObjectAccessType access, void *arg)
17951795
returnpsprintf("%s%s%s%s%s%s",
17961796
((drop_arg->dropflags&PERFORM_DELETION_INTERNAL)
17971797
?"internal action," :""),
1798-
((drop_arg->dropflags&PERFORM_DELETION_INTERNAL)
1798+
((drop_arg->dropflags&PERFORM_DELETION_CONCURRENTLY)
17991799
?"concurrent drop," :""),
1800-
((drop_arg->dropflags&PERFORM_DELETION_INTERNAL)
1800+
((drop_arg->dropflags&PERFORM_DELETION_QUIETLY)
18011801
?"suppress notices," :""),
1802-
((drop_arg->dropflags&PERFORM_DELETION_INTERNAL)
1802+
((drop_arg->dropflags&PERFORM_DELETION_SKIP_ORIGINAL)
18031803
?"keep original object," :""),
1804-
((drop_arg->dropflags&PERFORM_DELETION_INTERNAL)
1804+
((drop_arg->dropflags&PERFORM_DELETION_SKIP_EXTENSIONS)
18051805
?"keep extensions," :""),
1806-
((drop_arg->dropflags&PERFORM_DELETION_INTERNAL)
1806+
((drop_arg->dropflags&PERFORM_DELETION_CONCURRENT_LOCK)
18071807
?"normal concurrent drop," :""));
18081808
}
18091809
break;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp