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

Commitb6e7780

Browse files
committed
Fix add_rte_to_flat_rtable() for recent feature additions.
The TABLESAMPLE and row security patches each overlooked this function,though their errors of omission were opposite: RLS failed to zero out thesecurityQuals field, leading to wasteful copying of useless expressiontrees in finished plans, while TABLESAMPLE neglected to add a commentsaying that it intentionally *isn't* deleting the tablesample subtree.There probably should be a similar comment about ctename, too.Back-patch as appropriate.
1 parent49c3000 commitb6e7780

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

‎src/backend/optimizer/plan/setrefs.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,10 +365,10 @@ flatten_rtes_walker(Node *node, PlannerGlobal *glob)
365365
*
366366
* In the flat rangetable, we zero out substructure pointers that are not
367367
* needed by the executor; this reduces the storage space and copying cost
368-
* for cached plans. We keep only the alias and eref Alias fields, which
369-
* are needed by EXPLAIN, and the selectedCols and modifiedCols bitmaps,
370-
* which are needed for executor-startup permissions checking and for
371-
*triggerevent checking.
368+
* for cached plans. We keep only thectename,alias and eref Alias fields,
369+
*whichare needed by EXPLAIN, and the selectedCols and modifiedCols bitmaps,
370+
* which are needed for executor-startup permissions checking and for trigger
371+
* event checking.
372372
*/
373373
staticvoid
374374
add_rte_to_flat_rtable(PlannerGlobal*glob,RangeTblEntry*rte)
@@ -388,6 +388,7 @@ add_rte_to_flat_rtable(PlannerGlobal *glob, RangeTblEntry *rte)
388388
newrte->ctecoltypes=NIL;
389389
newrte->ctecoltypmods=NIL;
390390
newrte->ctecolcollations=NIL;
391+
newrte->securityQuals=NIL;
391392

392393
glob->finalrtable=lappend(glob->finalrtable,newrte);
393394

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp