Re: parallel.c is not marked as test covered - Mailing list pgsql-hackers

From Robert Haas
Subject Re: parallel.c is not marked as test covered
Date
Msg-id CA+TgmoZCkBTO_bkPNFL1QF+AS=TCg=Sx_uvbuvDQNx2GJU0VZA@mail.gmail.com
Whole thread Raw
In response to Re: parallel.c is not marked as test covered  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: parallel.c is not marked as test covered  (David Rowley <david.rowley@2ndquadrant.com>)
List pgsql-hackers
On Wed, May 11, 2016 at 1:57 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> I don't immediately understand what's going wrong here.  It looks to
> me like make_group_input_target() already called, and that worked OK,
> but now make_partialgroup_input_target() is failing using more-or-less
> the same logic.  Presumably that's because make_group_input_target()
> was called on final_target as returned by create_pathtarget(root,
> tlist), but make_partialgroup_input_target() is being called on
> grouping_target, which I'm guessing came from
> make_window_input_target, which somehow lacks sortgroupref labeling.
> But I don't immediately see how that would happen, so there's
> obviously something I'm missing here.

So, it turns out you can reproduce this bug pretty easily without
force_parallel_mode, like this:

alter table int4_tbl set (parallel_degree = 4);
SELECT SUM(COUNT(f1)) OVER () FROM int4_tbl WHERE f1=42;

Or you can just a query that involves a window function on a table
large enough for parallelism to be considered:

SELECT SUM(COUNT(aid)) OVER () FROM pgbench_accounts;

The crash goes way if the target list involves at least one plain
column that uses no aggregate or window function, because then the
PathTarget list has a sortgrouprefs array.  Trivial fix patch
attached, although some more review from you (Tom Lane, PathTarget
inventor and planner whiz) and David Rowley (author of this function)
would be appreciated in case there are deeper issues here.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment

pgsql-hackers by date:

Previous
From: Fabrízio de Royes Mello
Date:
Subject: Re: Does Type Have = Operator?
Next
From: Gavin Flower
Date:
Subject: Re: Academic help for Postgres