Skip to content

Commit 53e2b79

Browse files
committed
Repair oversight in recent change of dependency extraction code: when
recursing to handle a join alias var, the context had better be set to be appropriate to the join var's query level. Per report from Hristo Neshev.
1 parent 20f2872 commit 53e2b79

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/backend/catalog/dependency.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/catalog/dependency.c,v 1.13 2002/11/30 21:25:04 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/catalog/dependency.c,v 1.14 2002/12/04 20:00:37 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -789,13 +789,19 @@ find_expr_references_walker(Node *node,
789789
else if (rte->rtekind == RTE_JOIN)
790790
{
791791
/* Scan join output column to add references to join inputs */
792+
List *save_rtables;
793+
794+
/* We must make the context appropriate for join's level */
795+
save_rtables = context->rtables;
796+
context->rtables = rtables;
792797
if (var->varattno <= 0 ||
793798
var->varattno > length(rte->joinaliasvars))
794799
elog(ERROR, "find_expr_references_walker: bogus varattno %d",
795800
var->varattno);
796801
find_expr_references_walker((Node *) nth(var->varattno - 1,
797802
rte->joinaliasvars),
798803
context);
804+
context->rtables = save_rtables;
799805
}
800806
return false;
801807
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy