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

Commite414ba9

Browse files
committed
Fix Var handling for security barrier views
In some cases, not all Vars were being correctly marked as having beenmodified for updatable security barrier views, which resulted in invalidplans (eg: when security barrier views were created over top ofinheiritance structures).In passing, be sure to update both varattno and varonattno, as _equalVarwon't consider the Vars identical otherwise. This isn't known to causeany issues with updatable security barrier views, but was noticed asmissing while working on RLS and makes sense to get fixed.Back-patch to 9.4 where updatable security barrier views wereintroduced.
1 parent8e484bc commite414ba9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎src/backend/optimizer/prep/prepsecurity.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,9 @@ security_barrier_replace_vars_walker(Node *node,
398398
((Var*)tle->expr)->varcollid==var->varcollid)
399399
{
400400
/* Map the variable onto this subquery targetlist entry */
401-
var->varattno=attno;
401+
var->varattno=var->varoattno=attno;
402+
/* Mark this var as having been processed */
403+
context->vars_processed=lappend(context->vars_processed,var);
402404
return false;
403405
}
404406
}
@@ -444,7 +446,7 @@ security_barrier_replace_vars_walker(Node *node,
444446
makeString(pstrdup(attname)));
445447

446448
/* Update the outer query's variable */
447-
var->varattno=attno;
449+
var->varattno=var->varoattno=attno;
448450

449451
/* Remember this Var so that we don't process it again */
450452
context->vars_processed=lappend(context->vars_processed,var);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp