Richard Guo <riguo@pivotal.io> wrote:
> Another core dump for query below:
>
> select sum(t1.s1) from t1, t2, t3, t4 where t1.j1 = t2.j2 group by t1.g1, t2.g2;
>
> This is due to a small mistake:
>
> diff --git a/src/backend/optimizer/util/relnode.c b/src/backend/optimizer/util/relnode.c
> index 10becc0..9c2deed 100644
> --- a/src/backend/optimizer/util/relnode.c
> +++ b/src/backend/optimizer/util/relnode.c
> @@ -648,7 +648,7 @@ void
> add_grouped_rel(PlannerInfo *root, RelOptInfo *rel, RelAggInfo *agg_info)
> {
> add_rel_info(root->grouped_rel_list, rel);
> - add_rel_info(root->agg_info_list, rel);
> + add_rel_info(root->agg_info_list, agg_info);
> }
>
Thanks! Yes, this is what I had to fix.
--
Antonin Houska
Web: https://www.cybertec-postgresql.com