pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Fix failure to mark all aggregates with appropriate transtype.
Date: Sat, 02 Jul 2016 17:23:28 +0000
Message-ID: <E1bJOdc-0003ga-Qt@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Fix failure to mark all aggregates with appropriate transtype.

In commit 915b703e1 I gave get_agg_clause_costs() the responsibility of
marking Aggref nodes with the appropriate aggtranstype.  I failed to notice
that where it was being called from, it might see only a subset of the
Aggref nodes that were in the original targetlist.  Specifically, if there
are duplicate aggregate calls in the tlist, either make_sort_input_target
or make_window_input_target might put just a single instance into the
grouping_target, and then only that instance would get marked.  Fix by
moving the call back into grouping_planner(), before we start building
assorted PathTargets from the query tlist.  Per report from Stefan Huehner.

Report: <20160702131056.GD3165@huehner.biz>

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/420c1661630c96ad10f58ca967d5f561bb404cf9

Modified Files
--------------
src/backend/optimizer/plan/planner.c | 54 ++++++++++++++++++++++--------------
src/test/regress/expected/limit.out  | 24 ++++++++++++++++
src/test/regress/sql/limit.sql       |  8 ++++++
3 files changed, 65 insertions(+), 21 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1bJOdc-0003ga-Qt@gemulon.postgresql.org>
Permalink:  ../E1bJOdc-0003ga-Qt@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1bJOdc-0003ga-Qt@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Fix failure to mark all aggregates with appropriate transtype.
  In-Reply-To: <E1bJOdc-0003ga-Qt@gemulon.postgresql.org>
  References: <E1bJOdc-0003ga-Qt@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox