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

Commitcb087ec

Browse files
committed
Copy the relation name for error reporting in WCOs
In get_row_security_policies(), we need to make a copy of the relationname when building the WithCheckOptions structure, sinceRelationGetRelationName just returns a pointer into the local Relationstructure. The relation name in the WCO structure is only used forerror reporting.Pointed out by Robert and Christian Ullrich, who noted that thebuildfarm members with -DCLOBBER_CACHE_ALWAYS were failing.
1 parent62420ae commitcb087ec

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎src/backend/rewrite/rowsecurity.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ get_row_security_policies(Query* root, RangeTblEntry* rte, int rt_index,
259259
WithCheckOption*wco;
260260

261261
wco= (WithCheckOption*)makeNode(WithCheckOption);
262-
wco->viewname=RelationGetRelationName(rel);
262+
wco->viewname=pstrdup(RelationGetRelationName(rel));
263263
wco->qual= (Node*)hook_with_check_expr_restrictive;
264264
wco->cascaded= false;
265265
*withCheckOptions=lappend(*withCheckOptions,wco);
@@ -274,7 +274,7 @@ get_row_security_policies(Query* root, RangeTblEntry* rte, int rt_index,
274274
WithCheckOption*wco;
275275

276276
wco= (WithCheckOption*)makeNode(WithCheckOption);
277-
wco->viewname=RelationGetRelationName(rel);
277+
wco->viewname=pstrdup(RelationGetRelationName(rel));
278278
wco->qual= (Node*)rowsec_with_check_expr;
279279
wco->cascaded= false;
280280
*withCheckOptions=lappend(*withCheckOptions,wco);
@@ -285,7 +285,7 @@ get_row_security_policies(Query* root, RangeTblEntry* rte, int rt_index,
285285
WithCheckOption*wco;
286286

287287
wco= (WithCheckOption*)makeNode(WithCheckOption);
288-
wco->viewname=RelationGetRelationName(rel);
288+
wco->viewname=pstrdup(RelationGetRelationName(rel));
289289
wco->qual= (Node*)hook_with_check_expr_permissive;
290290
wco->cascaded= false;
291291
*withCheckOptions=lappend(*withCheckOptions,wco);
@@ -303,7 +303,7 @@ get_row_security_policies(Query* root, RangeTblEntry* rte, int rt_index,
303303
combined_qual_eval=makeBoolExpr(OR_EXPR,combined_quals,-1);
304304

305305
wco= (WithCheckOption*)makeNode(WithCheckOption);
306-
wco->viewname=RelationGetRelationName(rel);
306+
wco->viewname=pstrdup(RelationGetRelationName(rel));
307307
wco->qual= (Node*)combined_qual_eval;
308308
wco->cascaded= false;
309309
*withCheckOptions=lappend(*withCheckOptions,wco);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp