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:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user