Commit d4c74651 authored by Tom Lane's avatar Tom Lane

Remove no-longer-used RTE argument of markVarForSelectPriv().

In the wake of c028faf2, this is no longer needed.  I left it
out of that patch since the API change would be undesirable in
a released branch; but there's no reason not to do it in HEAD.
parent 42d74e0c
...@@ -58,7 +58,6 @@ static int extractRemainingColumns(ParseNamespaceColumn *src_nscolumns, ...@@ -58,7 +58,6 @@ static int extractRemainingColumns(ParseNamespaceColumn *src_nscolumns,
List **res_colnames, List **res_colvars, List **res_colnames, List **res_colvars,
ParseNamespaceColumn *res_nscolumns); ParseNamespaceColumn *res_nscolumns);
static Node *transformJoinUsingClause(ParseState *pstate, static Node *transformJoinUsingClause(ParseState *pstate,
RangeTblEntry *leftRTE, RangeTblEntry *rightRTE,
List *leftVars, List *rightVars); List *leftVars, List *rightVars);
static Node *transformJoinOnClause(ParseState *pstate, JoinExpr *j, static Node *transformJoinOnClause(ParseState *pstate, JoinExpr *j,
List *namespace); List *namespace);
...@@ -302,7 +301,6 @@ extractRemainingColumns(ParseNamespaceColumn *src_nscolumns, ...@@ -302,7 +301,6 @@ extractRemainingColumns(ParseNamespaceColumn *src_nscolumns,
*/ */
static Node * static Node *
transformJoinUsingClause(ParseState *pstate, transformJoinUsingClause(ParseState *pstate,
RangeTblEntry *leftRTE, RangeTblEntry *rightRTE,
List *leftVars, List *rightVars) List *leftVars, List *rightVars)
{ {
Node *result; Node *result;
...@@ -325,8 +323,8 @@ transformJoinUsingClause(ParseState *pstate, ...@@ -325,8 +323,8 @@ transformJoinUsingClause(ParseState *pstate,
A_Expr *e; A_Expr *e;
/* Require read access to the join variables */ /* Require read access to the join variables */
markVarForSelectPriv(pstate, lvar, leftRTE); markVarForSelectPriv(pstate, lvar);
markVarForSelectPriv(pstate, rvar, rightRTE); markVarForSelectPriv(pstate, rvar);
/* Now create the lvar = rvar join condition */ /* Now create the lvar = rvar join condition */
e = makeSimpleA_Expr(AEXPR_OP, "=", e = makeSimpleA_Expr(AEXPR_OP, "=",
...@@ -1411,8 +1409,6 @@ transformFromClauseItem(ParseState *pstate, Node *n, ...@@ -1411,8 +1409,6 @@ transformFromClauseItem(ParseState *pstate, Node *n,
} }
j->quals = transformJoinUsingClause(pstate, j->quals = transformJoinUsingClause(pstate,
l_nsitem->p_rte,
r_nsitem->p_rte,
l_usingvars, l_usingvars,
r_usingvars); r_usingvars);
} }
......
...@@ -2525,7 +2525,7 @@ transformWholeRowRef(ParseState *pstate, ParseNamespaceItem *nsitem, ...@@ -2525,7 +2525,7 @@ transformWholeRowRef(ParseState *pstate, ParseNamespaceItem *nsitem,
result->location = location; result->location = location;
/* mark relation as requiring whole-row SELECT access */ /* mark relation as requiring whole-row SELECT access */
markVarForSelectPriv(pstate, result, nsitem->p_rte); markVarForSelectPriv(pstate, result);
return (Node *) result; return (Node *) result;
} }
......
...@@ -740,7 +740,7 @@ scanNSItemForColumn(ParseState *pstate, ParseNamespaceItem *nsitem, ...@@ -740,7 +740,7 @@ scanNSItemForColumn(ParseState *pstate, ParseNamespaceItem *nsitem,
var->location = location; var->location = location;
/* Require read access to the column */ /* Require read access to the column */
markVarForSelectPriv(pstate, var, rte); markVarForSelectPriv(pstate, var);
return (Node *) var; return (Node *) var;
} }
...@@ -1074,11 +1074,9 @@ markRTEForSelectPriv(ParseState *pstate, int rtindex, AttrNumber col) ...@@ -1074,11 +1074,9 @@ markRTEForSelectPriv(ParseState *pstate, int rtindex, AttrNumber col)
* markVarForSelectPriv * markVarForSelectPriv
* Mark the RTE referenced by the Var as requiring SELECT privilege * Mark the RTE referenced by the Var as requiring SELECT privilege
* for the Var's column (the Var could be a whole-row Var, too) * for the Var's column (the Var could be a whole-row Var, too)
*
* The rte argument is unused and will be removed later.
*/ */
void void
markVarForSelectPriv(ParseState *pstate, Var *var, RangeTblEntry *rte) markVarForSelectPriv(ParseState *pstate, Var *var)
{ {
Index lv; Index lv;
...@@ -3123,7 +3121,7 @@ expandNSItemAttrs(ParseState *pstate, ParseNamespaceItem *nsitem, ...@@ -3123,7 +3121,7 @@ expandNSItemAttrs(ParseState *pstate, ParseNamespaceItem *nsitem,
te_list = lappend(te_list, te); te_list = lappend(te_list, te);
/* Require read access to each column */ /* Require read access to each column */
markVarForSelectPriv(pstate, varnode, rte); markVarForSelectPriv(pstate, varnode);
} }
Assert(name == NULL && var == NULL); /* lists not the same length? */ Assert(name == NULL && var == NULL); /* lists not the same length? */
......
...@@ -1397,7 +1397,7 @@ ExpandSingleTable(ParseState *pstate, ParseNamespaceItem *nsitem, ...@@ -1397,7 +1397,7 @@ ExpandSingleTable(ParseState *pstate, ParseNamespaceItem *nsitem,
{ {
Var *var = (Var *) lfirst(l); Var *var = (Var *) lfirst(l);
markVarForSelectPriv(pstate, var, rte); markVarForSelectPriv(pstate, var);
} }
return vars; return vars;
......
...@@ -41,8 +41,7 @@ extern Node *scanNSItemForColumn(ParseState *pstate, ParseNamespaceItem *nsitem, ...@@ -41,8 +41,7 @@ extern Node *scanNSItemForColumn(ParseState *pstate, ParseNamespaceItem *nsitem,
int location); int location);
extern Node *colNameToVar(ParseState *pstate, const char *colname, bool localonly, extern Node *colNameToVar(ParseState *pstate, const char *colname, bool localonly,
int location); int location);
extern void markVarForSelectPriv(ParseState *pstate, Var *var, extern void markVarForSelectPriv(ParseState *pstate, Var *var);
RangeTblEntry *rte);
extern Relation parserOpenTable(ParseState *pstate, const RangeVar *relation, extern Relation parserOpenTable(ParseState *pstate, const RangeVar *relation,
int lockmode); int lockmode);
extern ParseNamespaceItem *addRangeTableEntry(ParseState *pstate, extern ParseNamespaceItem *addRangeTableEntry(ParseState *pstate,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment