pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix incorrect handling of polymorphic aggregates used as window
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix incorrect handling of polymorphic aggregates used as window
@ 2016-10-09 16:49  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2016-10-09 16:49 UTC (permalink / raw)
  To: pgsql-committers

Fix incorrect handling of polymorphic aggregates used as window functions.

The transfunction was told that its first argument and result were
of the window function output type, not the aggregate state type.
This'd only matter if the transfunction consults get_fn_expr_argtype,
which typically only polymorphic functions would do.

Although we have several regression tests around polymorphic aggs,
none of them detected this mistake --- in fact, they still didn't
fail when I injected the same mistake into nodeAgg.c.  So add some
more tests covering both plain agg and window-function-agg cases.

Per report from Sebastian Luque.  Back-patch to 9.6 where the error
was introduced (by sloppy refactoring in commit 804163bc2, looks like).

Report: <87int2qkat.fsf@gmail.com>

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/ac4a9d92fcb6869e757cc729dca2ca5ccf94b185

Modified Files
--------------
src/backend/executor/nodeWindowAgg.c       |  2 +-
src/test/regress/expected/polymorphism.out | 55 ++++++++++++++++++++++++++++++
src/test/regress/sql/polymorphism.sql      | 22 ++++++++++++
3 files changed, 78 insertions(+), 1 deletion(-)


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


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Fix incorrect handling of polymorphic aggregates used as window
@ 2016-10-09 16:49  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2016-10-09 16:49 UTC (permalink / raw)
  To: pgsql-committers

Fix incorrect handling of polymorphic aggregates used as window functions.

The transfunction was told that its first argument and result were
of the window function output type, not the aggregate state type.
This'd only matter if the transfunction consults get_fn_expr_argtype,
which typically only polymorphic functions would do.

Although we have several regression tests around polymorphic aggs,
none of them detected this mistake --- in fact, they still didn't
fail when I injected the same mistake into nodeAgg.c.  So add some
more tests covering both plain agg and window-function-agg cases.

Per report from Sebastian Luque.  Back-patch to 9.6 where the error
was introduced (by sloppy refactoring in commit 804163bc2, looks like).

Report: <87int2qkat.fsf@gmail.com>

Branch
------
REL9_6_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/dca25c2562199ce1e7e26367613912a8eadbbde8

Modified Files
--------------
src/backend/executor/nodeWindowAgg.c       |  2 +-
src/test/regress/expected/polymorphism.out | 55 ++++++++++++++++++++++++++++++
src/test/regress/sql/polymorphism.sql      | 22 ++++++++++++
3 files changed, 78 insertions(+), 1 deletion(-)


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


^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2016-10-09 16:49 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-10-09 16:49 pgsql: Fix incorrect handling of polymorphic aggregates used as window Tom Lane <tgl@sss.pgh.pa.us>
2016-10-09 16:49 pgsql: Fix incorrect handling of polymorphic aggregates used as window Tom Lane <tgl@sss.pgh.pa.us>

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