]> granicus.if.org Git - postgresql/commitdiff
Allow cpluspluscheck to pass by renaming variable
authorSimon Riggs <simon@2ndQuadrant.com>
Thu, 5 Apr 2018 19:06:02 +0000 (20:06 +0100)
committerSimon Riggs <simon@2ndQuadrant.com>
Thu, 5 Apr 2018 19:06:02 +0000 (20:06 +0100)
Use of a C++ keyword as a function name caused problems

Reported-by: Álvaro Herrera
src/backend/parser/parse_clause.c
src/include/parser/parse_clause.h

index 3cb761b4ed0ad31720e1b9a384d73626e09896f8..a00c2b46e62dfdfdd94dfe0d273815ec18523dc7 100644 (file)
@@ -1108,7 +1108,7 @@ Node *
 transformFromClauseItem(ParseState *pstate, Node *n,
                                                RangeTblEntry **top_rte, int *top_rti,
                                                RangeTblEntry **right_rte, int *right_rti,
-                                               List **namespace)
+                                               List **fnamespace)
 {
        if (IsA(n, RangeVar))
        {
@@ -1130,7 +1130,7 @@ transformFromClauseItem(ParseState *pstate, Node *n,
                Assert(rte == rt_fetch(rtindex, pstate->p_rtable));
                *top_rte = rte;
                *top_rti = rtindex;
-               *namespace = list_make1(makeDefaultNSItem(rte));
+               *fnamespace = list_make1(makeDefaultNSItem(rte));
                rtr = makeNode(RangeTblRef);
                rtr->rtindex = rtindex;
                return (Node *) rtr;
@@ -1148,7 +1148,7 @@ transformFromClauseItem(ParseState *pstate, Node *n,
                Assert(rte == rt_fetch(rtindex, pstate->p_rtable));
                *top_rte = rte;
                *top_rti = rtindex;
-               *namespace = list_make1(makeDefaultNSItem(rte));
+               *fnamespace = list_make1(makeDefaultNSItem(rte));
                rtr = makeNode(RangeTblRef);
                rtr->rtindex = rtindex;
                return (Node *) rtr;
@@ -1166,7 +1166,7 @@ transformFromClauseItem(ParseState *pstate, Node *n,
                Assert(rte == rt_fetch(rtindex, pstate->p_rtable));
                *top_rte = rte;
                *top_rti = rtindex;
-               *namespace = list_make1(makeDefaultNSItem(rte));
+               *fnamespace = list_make1(makeDefaultNSItem(rte));
                rtr = makeNode(RangeTblRef);
                rtr->rtindex = rtindex;
                return (Node *) rtr;
@@ -1184,7 +1184,7 @@ transformFromClauseItem(ParseState *pstate, Node *n,
                Assert(rte == rt_fetch(rtindex, pstate->p_rtable));
                *top_rte = rte;
                *top_rti = rtindex;
-               *namespace = list_make1(makeDefaultNSItem(rte));
+               *fnamespace = list_make1(makeDefaultNSItem(rte));
                rtr = makeNode(RangeTblRef);
                rtr->rtindex = rtindex;
                return (Node *) rtr;
@@ -1199,7 +1199,7 @@ transformFromClauseItem(ParseState *pstate, Node *n,
 
                /* Recursively transform the contained relation */
                rel = transformFromClauseItem(pstate, rts->relation,
-                                                                         top_rte, top_rti, NULL, NULL, namespace);
+                                                                         top_rte, top_rti, NULL, NULL, fnamespace);
                /* Currently, grammar could only return a RangeVar as contained rel */
                rtr = castNode(RangeTblRef, rel);
                rte = rt_fetch(rtr->rtindex, pstate->p_rtable);
@@ -1558,7 +1558,7 @@ transformFromClauseItem(ParseState *pstate, Node *n,
                 * The join RTE itself is always made visible for unqualified column
                 * names.  It's visible as a relation name only if it has an alias.
                 */
-               *namespace = lappend(my_namespace,
+               *fnamespace = lappend(my_namespace,
                                                         makeNamespaceItem(rte,
                                                                                           (j->alias != NULL),
                                                                                           true,
index 30121c98ed881e3e4f026819a513ea53d1e3b151..4420e7207089dffc230751fcc3e1b846dedfd4a9 100644 (file)
@@ -23,7 +23,7 @@ extern bool interpretOidsOption(List *defList, bool allowOids);
 extern Node *transformFromClauseItem(ParseState *pstate, Node *n,
                                                RangeTblEntry **top_rte, int *top_rti,
                                                RangeTblEntry **right_rte, int *right_rti,
-                                               List **namespace);
+                                               List **fnamespace);
 extern Node *transformWhereClause(ParseState *pstate, Node *clause,
                                         ParseExprKind exprKind, const char *constructName);
 extern Node *transformLimitClause(ParseState *pstate, Node *clause,