From e9c561ff12aed2c3a475763ab772a59f3a38b593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=80=E6=8C=83?= Date: Mon, 11 May 2020 15:57:54 +0800 Subject: [PATCH v8 7/7] Renamed adjust_inherited_tlist(List *tlist, AppendRelInfo *context) to adjust_inherited_tlist(List *tlist, AppendRelInfo *appinfo) because the `context` around that code is adjust_appendrel_attrs_context, The original variable name looks improper. --- src/backend/optimizer/util/appendinfo.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/backend/optimizer/util/appendinfo.c b/src/backend/optimizer/util/appendinfo.c index 44c37ecffc..42dec15f0f 100644 --- a/src/backend/optimizer/util/appendinfo.c +++ b/src/backend/optimizer/util/appendinfo.c @@ -38,7 +38,7 @@ static void make_inh_translation_list(Relation oldrelation, static Node *adjust_appendrel_attrs_mutator(Node *node, adjust_appendrel_attrs_context *context); static List *adjust_inherited_tlist(List *tlist, - AppendRelInfo *context); + AppendRelInfo *appinfo); /* @@ -637,7 +637,7 @@ adjust_child_relids_multilevel(PlannerInfo *root, Relids relids, * Note that this is not needed for INSERT because INSERT isn't inheritable. */ static List * -adjust_inherited_tlist(List *tlist, AppendRelInfo *context) +adjust_inherited_tlist(List *tlist, AppendRelInfo *appinfo) { bool changed_it = false; ListCell *tl; @@ -646,7 +646,7 @@ adjust_inherited_tlist(List *tlist, AppendRelInfo *context) int attrno; /* This should only happen for an inheritance case, not UNION ALL */ - Assert(OidIsValid(context->parent_reloid)); + Assert(OidIsValid(appinfo->parent_reloid)); /* Scan tlist and update resnos to match attnums of child rel */ foreach(tl, tlist) @@ -659,13 +659,13 @@ adjust_inherited_tlist(List *tlist, AppendRelInfo *context) /* Look up the translation of this column: it must be a Var */ if (tle->resno <= 0 || - tle->resno > list_length(context->translated_vars)) + tle->resno > list_length(appinfo->translated_vars)) elog(ERROR, "attribute %d of relation \"%s\" does not exist", - tle->resno, get_rel_name(context->parent_reloid)); - childvar = (Var *) list_nth(context->translated_vars, tle->resno - 1); + tle->resno, get_rel_name(appinfo->parent_reloid)); + childvar = (Var *) list_nth(appinfo->translated_vars, tle->resno - 1); if (childvar == NULL || !IsA(childvar, Var)) elog(ERROR, "attribute %d of relation \"%s\" does not exist", - tle->resno, get_rel_name(context->parent_reloid)); + tle->resno, get_rel_name(appinfo->parent_reloid)); if (tle->resno != childvar->varattno) { @@ -719,7 +719,7 @@ adjust_inherited_tlist(List *tlist, AppendRelInfo *context) /* * find_appinfos_by_relids - * Find AppendRelInfo structures for all relations specified by relids. + * Find AppendRelInfo structures for all relations specified by relids. * * The AppendRelInfos are returned in an array, which can be pfree'd by the * caller. *nappinfos is set to the number of entries in the array. -- 2.21.0