1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

Fix code related to partitioning schemes for dropped columns.

The entry in appinfo->translated_vars can be NULL; if so, we must avoid
dereferencing it.

Ashutosh Bapat

Discussion: http://postgr.es/m/CAFjFpReL7+1ien=-21rhjpO3bV7aAm1rQ8XgLVk2csFagSzpZQ@mail.gmail.com
This commit is contained in:
Robert Haas
2017-10-31 14:41:21 +05:30
parent 35f059e9bd
commit cf7ab13bfb
3 changed files with 23 additions and 0 deletions

View File

@ -950,6 +950,18 @@ set_append_rel_size(PlannerInfo *root, RelOptInfo *rel,
attno - 1);
int child_index;
/*
* Ignore any column dropped from the parent.
* Corresponding Var won't have any translation. It won't
* have attr_needed information, since it can not be
* referenced in the query.
*/
if (var == NULL)
{
Assert(attr_needed == NULL);
continue;
}
child_index = var->varattno - childrel->min_attr;
childrel->attr_needed[child_index] = attr_needed;
}