git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 20f2872)
Repair oversight in recent change of dependency extraction code: when
Wed, 4 Dec 2002 20:00:37 +0000 (20:00 +0000)
Wed, 4 Dec 2002 20:00:37 +0000 (20:00 +0000)
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.


diff --git a/src/backend/catalog/dependency.c b/src/backend/catalog/dependency.c
index d159ceba371773eda7086376eec9ad7c9207af94..c679c61e12ae2b25134849986e9f4796e259944c 100644 (file)
--- a/src/backend/catalog/dependency.c
+++ b/src/backend/catalog/dependency.c
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/dependency.c,v 1.13 2002年11月30日 21:25:04 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/dependency.c,v 1.14 2002年12月04日 20:00:37 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -789,6 +789,11 @@ find_expr_references_walker(Node *node,
else if (rte->rtekind == RTE_JOIN)
{
/* Scan join output column to add references to join inputs */
+ List *save_rtables;
+
+ /* We must make the context appropriate for join's level */
+ save_rtables = context->rtables;
+ context->rtables = rtables;
if (var->varattno <= 0 ||
var->varattno > length(rte->joinaliasvars))
elog(ERROR, "find_expr_references_walker: bogus varattno %d",
@@ -796,6 +801,7 @@ find_expr_references_walker(Node *node,
find_expr_references_walker((Node *) nth(var->varattno - 1,
rte->joinaliasvars),
context);
+ context->rtables = save_rtables;
}
return false;
}
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /