|
8 | 8 | * Portions Copyright (c) 1994, Regents of the University of California
|
9 | 9 | *
|
10 | 10 | * 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 $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
@@ -789,13 +789,19 @@ find_expr_references_walker(Node *node,
|
789 | 789 | elseif (rte->rtekind==RTE_JOIN)
|
790 | 790 | {
|
791 | 791 | /* 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; |
792 | 797 | if (var->varattno <=0||
|
793 | 798 | var->varattno>length(rte->joinaliasvars))
|
794 | 799 | elog(ERROR,"find_expr_references_walker: bogus varattno %d",
|
795 | 800 | var->varattno);
|
796 | 801 | find_expr_references_walker((Node*)nth(var->varattno-1,
|
797 | 802 | rte->joinaliasvars),
|
798 | 803 | context);
|
| 804 | +context->rtables=save_rtables; |
799 | 805 | }
|
800 | 806 | return false;
|
801 | 807 | }
|
|