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

Commit6e37312

Browse files
committed
Remove test_oat_hooks.c's nodetag_to_string().
In the short time this function has existed, it's already proven to bea nontrivial maintenance burden, since it has to be updated whenever anode tag is added or removed. Although in principle we could nowautomate that, I see little justification for having such functionalityhere at all. The function is only being applied to utility statements,for which we already have infrastructure for obtaining string names.Moreover, that infrastructure produces already-familiar-to-users names,unlike nodetag_to_string().So, remove this function and use the existing infrastructure instead.That saves over a thousand lines of largely-unreachable code.Back-patch to v15 where this code came in. Although it seems unlikelythat v15's nodetag list will change anymore, we might as well keep thetwo branches looking and acting alike; otherwise back-patching anytest-results changes in this area will be painful.Discussion:https://postgr.es/m/843818.1659218928@sss.pgh.pa.us
1 parent9c9fc20 commit6e37312

File tree

2 files changed

+81
-1407
lines changed

2 files changed

+81
-1407
lines changed

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

Lines changed: 80 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,26 @@ LOAD 'test_oat_hooks';
1111
SET test_oat_hooks.audit = true;
1212
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.audit]
1313
NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [test_oat_hooks.audit]
14-
NOTICE: in process utility: superuser finishedset
14+
NOTICE: in process utility: superuser finishedSET
1515
-- Creating privileges on an existent custom GUC should create precisely the
1616
-- right privileges, not overly conservative ones.
1717
GRANT SET ON PARAMETER test_oat_hooks.user_var2 TO regress_role_joe;
18-
NOTICE: in process utility: superuser attemptingGrantStmt
19-
NOTICE: in process utility: superuser finishedGrantStmt
18+
NOTICE: in process utility: superuser attemptingGRANT
19+
NOTICE: in process utility: superuser finishedGRANT
2020
GRANT SET ON PARAMETER test_oat_hooks.super_var2 TO regress_role_joe;
21-
NOTICE: in process utility: superuser attemptingGrantStmt
22-
NOTICE: in process utility: superuser finishedGrantStmt
21+
NOTICE: in process utility: superuser attemptingGRANT
22+
NOTICE: in process utility: superuser finishedGRANT
2323
-- Granting multiple privileges on a parameter should be reported correctly to
2424
-- the OAT hook, but beware that WITH GRANT OPTION is not represented.
2525
GRANT SET, ALTER SYSTEM ON PARAMETER none.such TO regress_role_joe;
26-
NOTICE: in process utility: superuser attemptingGrantStmt
27-
NOTICE: in process utility: superuser finishedGrantStmt
26+
NOTICE: in process utility: superuser attemptingGRANT
27+
NOTICE: in process utility: superuser finishedGRANT
2828
GRANT SET, ALTER SYSTEM ON PARAMETER another.bogus TO regress_role_joe WITH GRANT OPTION;
29-
NOTICE: in process utility: superuser attemptingGrantStmt
30-
NOTICE: in process utility: superuser finishedGrantStmt
29+
NOTICE: in process utility: superuser attemptingGRANT
30+
NOTICE: in process utility: superuser finishedGRANT
3131
-- Check when the hooks fire relative to dependency based abort of a drop
3232
DROP ROLE regress_role_joe;
33-
NOTICE: in process utility: superuser attemptingDropRoleStmt
33+
NOTICE: in process utility: superuser attemptingDROP ROLE
3434
NOTICE: in object access: superuser attempting drop (subId=0x0) []
3535
NOTICE: in object access: superuser finished drop (subId=0x0) []
3636
ERROR: role "regress_role_joe" cannot be dropped because some objects depend on it
@@ -42,30 +42,30 @@ privileges for parameter none.such
4242
privileges for parameter another.bogus
4343
-- Check the behavior of the hooks relative to do-nothing grants and revokes
4444
GRANT SET ON PARAMETER maintenance_work_mem TO PUBLIC;
45-
NOTICE: in process utility: superuser attemptingGrantStmt
46-
NOTICE: in process utility: superuser finishedGrantStmt
45+
NOTICE: in process utility: superuser attemptingGRANT
46+
NOTICE: in process utility: superuser finishedGRANT
4747
REVOKE SET ON PARAMETER maintenance_work_mem FROM PUBLIC;
48-
NOTICE: in process utility: superuser attemptingGrantStmt
49-
NOTICE: in process utility: superuser finishedGrantStmt
48+
NOTICE: in process utility: superuser attemptingREVOKE
49+
NOTICE: in process utility: superuser finishedREVOKE
5050
REVOKE ALTER SYSTEM ON PARAMETER maintenance_work_mem FROM PUBLIC;
51-
NOTICE: in process utility: superuser attemptingGrantStmt
52-
NOTICE: in process utility: superuser finishedGrantStmt
51+
NOTICE: in process utility: superuser attemptingREVOKE
52+
NOTICE: in process utility: superuser finishedREVOKE
5353
-- Check the behavior of the hooks relative to unrecognized parameters
5454
GRANT ALL ON PARAMETER "none.such" TO PUBLIC;
55-
NOTICE: in process utility: superuser attemptingGrantStmt
56-
NOTICE: in process utility: superuser finishedGrantStmt
55+
NOTICE: in process utility: superuser attemptingGRANT
56+
NOTICE: in process utility: superuser finishedGRANT
5757
-- Check relative to an operation that causes the catalog entry to be deleted
5858
REVOKE ALL ON PARAMETER "none.such" FROM PUBLIC;
59-
NOTICE: in process utility: superuser attemptingGrantStmt
60-
NOTICE: in process utility: superuser finishedGrantStmt
59+
NOTICE: in process utility: superuser attemptingREVOKE
60+
NOTICE: in process utility: superuser finishedREVOKE
6161
-- Create objects for use in the test
6262
CREATE USER regress_test_user;
63-
NOTICE: in process utility: superuser attemptingCreateRoleStmt
63+
NOTICE: in process utility: superuser attemptingCREATE ROLE
6464
NOTICE: in object access: superuser attempting create (subId=0x0) [explicit]
6565
NOTICE: in object access: superuser finished create (subId=0x0) [explicit]
66-
NOTICE: in process utility: superuser finishedCreateRoleStmt
66+
NOTICE: in process utility: superuser finishedCREATE ROLE
6767
CREATE TABLE regress_test_table (t text);
68-
NOTICE: in process utility: superuser attemptingCreateStmt
68+
NOTICE: in process utility: superuser attemptingCREATE TABLE
6969
NOTICE: in object access: superuser attempting namespace search (subId=0x0) [no report on violation, allowed]
7070
LINE 1: CREATE TABLE regress_test_table (t text);
7171
^
@@ -82,20 +82,20 @@ NOTICE: in object access: superuser attempting create (subId=0x0) [internal]
8282
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]
85-
NOTICE: in process utility: superuser finishedCreateStmt
85+
NOTICE: in process utility: superuser finishedCREATE TABLE
8686
GRANT SELECT ON Table regress_test_table TO public;
87-
NOTICE: in process utility: superuser attemptingGrantStmt
88-
NOTICE: in process utility: superuser finishedGrantStmt
87+
NOTICE: in process utility: superuser attemptingGRANT
88+
NOTICE: in process utility: superuser finishedGRANT
8989
CREATE FUNCTION regress_test_func (t text) RETURNS text AS $$
9090
SELECT $1;
9191
$$ LANGUAGE sql;
92-
NOTICE: in process utility: superuser attemptingCreateFunctionStmt
92+
NOTICE: in process utility: superuser attemptingCREATE FUNCTION
9393
NOTICE: in object access: superuser attempting create (subId=0x0) [explicit]
9494
NOTICE: in object access: superuser finished create (subId=0x0) [explicit]
95-
NOTICE: in process utility: superuser finishedCreateFunctionStmt
95+
NOTICE: in process utility: superuser finishedCREATE FUNCTION
9696
GRANT EXECUTE ON FUNCTION regress_test_func (text) TO public;
97-
NOTICE: in process utility: superuser attemptingGrantStmt
98-
NOTICE: in process utility: superuser finishedGrantStmt
97+
NOTICE: in process utility: superuser attemptingGRANT
98+
NOTICE: in process utility: superuser finishedGRANT
9999
-- Do a few things as superuser
100100
SELECT * FROM regress_test_table;
101101
NOTICE: in executor check perms: superuser attempting execute
@@ -113,31 +113,31 @@ NOTICE: in executor check perms: superuser finished execute
113113
(1 row)
114114

115115
SET work_mem = 8192;
116-
NOTICE: in process utility: superuser attemptingset
116+
NOTICE: in process utility: superuser attemptingSET
117117
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [work_mem]
118118
NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [work_mem]
119-
NOTICE: in process utility: superuser finishedset
119+
NOTICE: in process utility: superuser finishedSET
120120
RESET work_mem;
121-
NOTICE: in process utility: superuser attemptingset
121+
NOTICE: in process utility: superuser attemptingRESET
122122
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [work_mem]
123123
NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [work_mem]
124-
NOTICE: in process utility: superuser finishedset
124+
NOTICE: in process utility: superuser finishedRESET
125125
ALTER SYSTEM SET work_mem = 8192;
126-
NOTICE: in process utility: superuser attemptingalter system
126+
NOTICE: in process utility: superuser attemptingALTER SYSTEM
127127
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x2000, alter system) [work_mem]
128128
NOTICE: in object_access_hook_str: superuser finished alter (subId=0x2000, alter system) [work_mem]
129-
NOTICE: in process utility: superuser finishedalter system
129+
NOTICE: in process utility: superuser finishedALTER SYSTEM
130130
ALTER SYSTEM RESET work_mem;
131-
NOTICE: in process utility: superuser attemptingalter system
131+
NOTICE: in process utility: superuser attemptingALTER SYSTEM
132132
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x2000, alter system) [work_mem]
133133
NOTICE: in object_access_hook_str: superuser finished alter (subId=0x2000, alter system) [work_mem]
134-
NOTICE: in process utility: superuser finishedalter system
134+
NOTICE: in process utility: superuser finishedALTER SYSTEM
135135
-- Do those same things as non-superuser
136136
SET SESSION AUTHORIZATION regress_test_user;
137-
NOTICE: in process utility: superuser attemptingset
137+
NOTICE: in process utility: superuser attemptingSET
138138
NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [session_authorization]
139139
NOTICE: in object_access_hook_str: non-superuser finished alter (subId=0x1000, set) [session_authorization]
140-
NOTICE: in process utility: non-superuser finishedset
140+
NOTICE: in process utility: non-superuser finishedSET
141141
SELECT * FROM regress_test_table;
142142
NOTICE: in object access: non-superuser attempting namespace search (subId=0x0) [no report on violation, allowed]
143143
LINE 1: SELECT * FROM regress_test_table;
@@ -160,83 +160,83 @@ NOTICE: in executor check perms: non-superuser finished execute
160160
(1 row)
161161

162162
SET work_mem = 8192;
163-
NOTICE: in process utility: non-superuser attemptingset
163+
NOTICE: in process utility: non-superuser attemptingSET
164164
NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [work_mem]
165165
NOTICE: in object_access_hook_str: non-superuser finished alter (subId=0x1000, set) [work_mem]
166-
NOTICE: in process utility: non-superuser finishedset
166+
NOTICE: in process utility: non-superuser finishedSET
167167
RESET work_mem;
168-
NOTICE: in process utility: non-superuser attemptingset
168+
NOTICE: in process utility: non-superuser attemptingRESET
169169
NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [work_mem]
170170
NOTICE: in object_access_hook_str: non-superuser finished alter (subId=0x1000, set) [work_mem]
171-
NOTICE: in process utility: non-superuser finishedset
171+
NOTICE: in process utility: non-superuser finishedRESET
172172
ALTER SYSTEM SET work_mem = 8192;
173-
NOTICE: in process utility: non-superuser attemptingalter system
173+
NOTICE: in process utility: non-superuser attemptingALTER SYSTEM
174174
ERROR: permission denied to set parameter "work_mem"
175175
ALTER SYSTEM RESET work_mem;
176-
NOTICE: in process utility: non-superuser attemptingalter system
176+
NOTICE: in process utility: non-superuser attemptingALTER SYSTEM
177177
ERROR: permission denied to set parameter "work_mem"
178178
SET test_oat_hooks.user_var1 = true;
179-
NOTICE: in process utility: non-superuser attemptingset
179+
NOTICE: in process utility: non-superuser attemptingSET
180180
NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [test_oat_hooks.user_var1]
181181
NOTICE: in object_access_hook_str: non-superuser finished alter (subId=0x1000, set) [test_oat_hooks.user_var1]
182-
NOTICE: in process utility: non-superuser finishedset
182+
NOTICE: in process utility: non-superuser finishedSET
183183
SET test_oat_hooks.super_var1 = true;
184-
NOTICE: in process utility: non-superuser attemptingset
184+
NOTICE: in process utility: non-superuser attemptingSET
185185
ERROR: permission denied to set parameter "test_oat_hooks.super_var1"
186186
ALTER SYSTEM SET test_oat_hooks.user_var1 = true;
187-
NOTICE: in process utility: non-superuser attemptingalter system
187+
NOTICE: in process utility: non-superuser attemptingALTER SYSTEM
188188
ERROR: permission denied to set parameter "test_oat_hooks.user_var1"
189189
ALTER SYSTEM SET test_oat_hooks.super_var1 = true;
190-
NOTICE: in process utility: non-superuser attemptingalter system
190+
NOTICE: in process utility: non-superuser attemptingALTER SYSTEM
191191
ERROR: permission denied to set parameter "test_oat_hooks.super_var1"
192192
SET test_oat_hooks.user_var2 = true;
193-
NOTICE: in process utility: non-superuser attemptingset
193+
NOTICE: in process utility: non-superuser attemptingSET
194194
NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [test_oat_hooks.user_var2]
195195
NOTICE: in object_access_hook_str: non-superuser finished alter (subId=0x1000, set) [test_oat_hooks.user_var2]
196-
NOTICE: in process utility: non-superuser finishedset
196+
NOTICE: in process utility: non-superuser finishedSET
197197
SET test_oat_hooks.super_var2 = true;
198-
NOTICE: in process utility: non-superuser attemptingset
198+
NOTICE: in process utility: non-superuser attemptingSET
199199
ERROR: permission denied to set parameter "test_oat_hooks.super_var2"
200200
ALTER SYSTEM SET test_oat_hooks.user_var2 = true;
201-
NOTICE: in process utility: non-superuser attemptingalter system
201+
NOTICE: in process utility: non-superuser attemptingALTER SYSTEM
202202
ERROR: permission denied to set parameter "test_oat_hooks.user_var2"
203203
ALTER SYSTEM SET test_oat_hooks.super_var2 = true;
204-
NOTICE: in process utility: non-superuser attemptingalter system
204+
NOTICE: in process utility: non-superuser attemptingALTER SYSTEM
205205
ERROR: permission denied to set parameter "test_oat_hooks.super_var2"
206206
RESET SESSION AUTHORIZATION;
207-
NOTICE: in process utility: non-superuser attemptingset
207+
NOTICE: in process utility: non-superuser attemptingRESET
208208
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [session_authorization]
209209
NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [session_authorization]
210-
NOTICE: in process utility: superuser finishedset
210+
NOTICE: in process utility: superuser finishedRESET
211211
-- Turn off non-superuser permissions
212212
SET test_oat_hooks.deny_set_variable = true;
213-
NOTICE: in process utility: superuser attemptingset
213+
NOTICE: in process utility: superuser attemptingSET
214214
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.deny_set_variable]
215215
NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [test_oat_hooks.deny_set_variable]
216-
NOTICE: in process utility: superuser finishedset
216+
NOTICE: in process utility: superuser finishedSET
217217
SET test_oat_hooks.deny_alter_system = true;
218-
NOTICE: in process utility: superuser attemptingset
218+
NOTICE: in process utility: superuser attemptingSET
219219
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.deny_alter_system]
220220
NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [test_oat_hooks.deny_alter_system]
221-
NOTICE: in process utility: superuser finishedset
221+
NOTICE: in process utility: superuser finishedSET
222222
SET test_oat_hooks.deny_object_access = true;
223-
NOTICE: in process utility: superuser attemptingset
223+
NOTICE: in process utility: superuser attemptingSET
224224
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.deny_object_access]
225225
NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [test_oat_hooks.deny_object_access]
226-
NOTICE: in process utility: superuser finishedset
226+
NOTICE: in process utility: superuser finishedSET
227227
SET test_oat_hooks.deny_exec_perms = true;
228-
NOTICE: in process utility: superuser attemptingset
228+
NOTICE: in process utility: superuser attemptingSET
229229
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.deny_exec_perms]
230230
NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [test_oat_hooks.deny_exec_perms]
231-
NOTICE: in process utility: superuser finishedset
231+
NOTICE: in process utility: superuser finishedSET
232232
SET test_oat_hooks.deny_utility_commands = true;
233-
NOTICE: in process utility: superuser attemptingset
233+
NOTICE: in process utility: superuser attemptingSET
234234
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.deny_utility_commands]
235235
NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [test_oat_hooks.deny_utility_commands]
236-
NOTICE: in process utility: superuser finishedset
236+
NOTICE: in process utility: superuser finishedSET
237237
-- Try again as non-superuser with permissions denied
238238
SET SESSION AUTHORIZATION regress_test_user;
239-
NOTICE: in process utility: superuser attemptingset
239+
NOTICE: in process utility: superuser attemptingSET
240240
NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [session_authorization]
241241
ERROR: permission denied: set session_authorization
242242
SELECT * FROM regress_test_table;
@@ -261,33 +261,33 @@ NOTICE: in executor check perms: superuser finished execute
261261
(1 row)
262262

263263
SET work_mem = 8192;
264-
NOTICE: in process utility: superuser attemptingset
264+
NOTICE: in process utility: superuser attemptingSET
265265
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [work_mem]
266266
NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [work_mem]
267-
NOTICE: in process utility: superuser finishedset
267+
NOTICE: in process utility: superuser finishedSET
268268
RESET work_mem;
269-
NOTICE: in process utility: superuser attemptingset
269+
NOTICE: in process utility: superuser attemptingRESET
270270
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [work_mem]
271271
NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [work_mem]
272-
NOTICE: in process utility: superuser finishedset
272+
NOTICE: in process utility: superuser finishedRESET
273273
ALTER SYSTEM SET work_mem = 8192;
274-
NOTICE: in process utility: superuser attemptingalter system
274+
NOTICE: in process utility: superuser attemptingALTER SYSTEM
275275
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x2000, alter system) [work_mem]
276276
NOTICE: in object_access_hook_str: superuser finished alter (subId=0x2000, alter system) [work_mem]
277-
NOTICE: in process utility: superuser finishedalter system
277+
NOTICE: in process utility: superuser finishedALTER SYSTEM
278278
ALTER SYSTEM RESET work_mem;
279-
NOTICE: in process utility: superuser attemptingalter system
279+
NOTICE: in process utility: superuser attemptingALTER SYSTEM
280280
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x2000, alter system) [work_mem]
281281
NOTICE: in object_access_hook_str: superuser finished alter (subId=0x2000, alter system) [work_mem]
282-
NOTICE: in process utility: superuser finishedalter system
282+
NOTICE: in process utility: superuser finishedALTER SYSTEM
283283
-- Clean up
284284
RESET SESSION AUTHORIZATION;
285-
NOTICE: in process utility: superuser attemptingset
285+
NOTICE: in process utility: superuser attemptingRESET
286286
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [session_authorization]
287287
NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [session_authorization]
288-
NOTICE: in process utility: superuser finishedset
288+
NOTICE: in process utility: superuser finishedRESET
289289
SET test_oat_hooks.audit = false;
290-
NOTICE: in process utility: superuser attemptingset
290+
NOTICE: in process utility: superuser attemptingSET
291291
DROP ROLE regress_role_joe; -- fails
292292
ERROR: role "regress_role_joe" cannot be dropped because some objects depend on it
293293
DETAIL: privileges for parameter test_oat_hooks.user_var1

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp