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

Commit9fd4de1

Browse files
committed
Compute root->qual_security_level in a less random place.
We can set this up once and for all in subquery_planner's initial surveyof the flattened rangetable, rather than incrementally adjusting it inbuild_simple_rel. The previous approach made it rather hard to reasonabout exactly when the value would be available, and we were definitelyusing it in some places before the final value was computed.Noted while fooling around with Amit Langote's patch to delay creationof inheritance child rels. That didn't break this code, but it made iteven more fragile, IMO.
1 parent2aa6e33 commit9fd4de1

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,16 @@ subquery_planner(PlannerGlobal *glob, Query *parse,
731731

732732
if (rte->lateral)
733733
root->hasLateralRTEs= true;
734+
735+
/*
736+
* We can also determine the maximum security level required for any
737+
* securityQuals now. Addition of inheritance-child RTEs won't affect
738+
* this, because child tables don't have their own securityQuals; see
739+
* expand_single_inheritance_child().
740+
*/
741+
if (rte->securityQuals)
742+
root->qual_security_level=Max(root->qual_security_level,
743+
list_length(rte->securityQuals));
734744
}
735745

736746
/*

‎src/backend/optimizer/util/relnode.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -324,17 +324,6 @@ build_simple_rel(PlannerInfo *root, int relid, RelOptInfo *parent)
324324
break;
325325
}
326326

327-
/*
328-
* This is a convenient spot at which to note whether rels participating
329-
* in the query have any securityQuals attached. If so, increase
330-
* root->qual_security_level to ensure it's larger than the maximum
331-
* security level needed for securityQuals. (Must do this before we call
332-
* apply_child_basequals, else we'll hit an Assert therein.)
333-
*/
334-
if (rte->securityQuals)
335-
root->qual_security_level=Max(root->qual_security_level,
336-
list_length(rte->securityQuals));
337-
338327
/*
339328
* Copy the parent's quals to the child, with appropriate substitution of
340329
* variables. If any constant false or NULL clauses turn up, we can mark

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp