Re: Grouping Sets: Fix unrecognized node type bug - Mailing list pgsql-hackers

From Jeevan Chalke
Subject Re: Grouping Sets: Fix unrecognized node type bug
Date
Msg-id CAM2+6=X9QWgbjJrR-dcLXh-RvvpGy=9ENhUOGHzrxhcJ2kVDSQ@mail.gmail.com
Whole thread Raw
In response to Re: Grouping Sets: Fix unrecognized node type bug  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Responses Re: Grouping Sets: Fix unrecognized node type bug
List pgsql-hackers


On Sat, Jul 18, 2015 at 12:27 AM, Andrew Gierth <andrew@tao11.riddles.org.uk> wrote:
>>>>> "Kyotaro" == Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> writes:

 Kyotaro> Hello, this looks to be a kind of thinko. The attached patch
 Kyotaro> fixes it.

No, that's still wrong. Just knowing that there is a List is not enough
to tell whether to concat it or append it.

Jeevan's original patch tries to get around this by making the RowExpr
case wrap another List around its result (which is then removed by the
concat), but this is the wrong approach too because it breaks nested
RowExprs (which isn't valid syntax in the spec, because the spec allows
only column references in GROUP BY, not arbitrary expressions, but which
we have no reason not to support).

Attached is the current version of my fix (with Jeevan's regression
tests plus one of mine).

Looks good to me.
 

--
Andrew (irc:RhodiumToad)




--
Jeevan B Chalke
Principal Software Engineer, Product Development
EnterpriseDB Corporation
The Enterprise PostgreSQL Company

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: object_classes array is broken, again
Next
From: Petr Jelinek
Date:
Subject: Re: TABLESAMPLE patch is really in pretty sad shape