From e64bb65aff3f53b4f56b4a1ee549930b568cec99 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 6 Oct 2008 15:15:22 +0000 Subject: Fix GetCTEForRTE() to deal with the possibility that the RTE it's given came from a query level above the current ParseState. --- src/include/parser/parse_relation.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/include/parser') diff --git a/src/include/parser/parse_relation.h b/src/include/parser/parse_relation.h index f5212c421b7..84cfa97ba36 100644 --- a/src/include/parser/parse_relation.h +++ b/src/include/parser/parse_relation.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/parser/parse_relation.h,v 1.60 2008/10/06 02:12:56 tgl Exp $ + * $PostgreSQL: pgsql/src/include/parser/parse_relation.h,v 1.61 2008/10/06 15:15:22 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -34,7 +34,8 @@ extern int RTERangeTablePosn(ParseState *pstate, extern RangeTblEntry *GetRTEByRangeTablePosn(ParseState *pstate, int varno, int sublevels_up); -extern CommonTableExpr *GetCTEForRTE(ParseState *pstate, RangeTblEntry *rte); +extern CommonTableExpr *GetCTEForRTE(ParseState *pstate, RangeTblEntry *rte, + int rtelevelsup); extern Node *scanRTEForColumn(ParseState *pstate, RangeTblEntry *rte, char *colname, int location); extern Node *colNameToVar(ParseState *pstate, char *colname, bool localonly, -- cgit v1.2.3