postgresql/src
Tom Lane c3dfe0fec0 Repair breakage of aggregate FILTER option.
An aggregate's input expression(s) are not supposed to be evaluated
at all for a row where its FILTER test fails ... but commit 8ed3f11bb
overlooked that requirement.  Reshuffle so that aggregates having a
filter clause evaluate their arguments separately from those without.
This still gets the benefit of doing only one ExecProject in the
common case of multiple Aggrefs, none of which have filters.

While at it, arrange for filter clauses to be included in the common
ExecProject evaluation, thus perhaps buying a little bit even when
there are filters.

Back-patch to v10 where the bug was introduced.

Discussion: https://postgr.es/m/30065.1508161354@sss.pgh.pa.us
2017-10-16 15:24:36 -04:00
..
backend Repair breakage of aggregate FILTER option. 2017-10-16 15:24:36 -04:00
bin Explicitly track whether aggregate final functions modify transition state. 2017-10-14 15:21:39 -04:00
common Rewrite strnlen replacement implementation from 8a241792f9. 2017-10-10 14:50:30 -07:00
fe_utils Provide a test for variable existence in psql 2017-09-21 19:02:23 -04:00
include Repair breakage of aggregate FILTER option. 2017-10-16 15:24:36 -04:00
interfaces Add port/strnlen support to libpq and ecpg Makefiles. 2017-10-11 11:28:04 -04:00
makefiles Always use -fPIC, not -fpic, when building shared libraries with gcc. 2017-06-01 13:32:55 -04:00
pl Use Py_RETURN_NONE where suitable 2017-09-29 16:51:39 -04:00
port Rewrite strnlen replacement implementation from 8a241792f9. 2017-10-10 14:50:30 -07:00
template Force "restrict" not to be used when compiling with xlc. 2017-10-13 12:15:06 -07:00
test Repair breakage of aggregate FILTER option. 2017-10-16 15:24:36 -04:00
timezone Sync our copy of the timezone library with IANA tzcode master. 2017-09-22 00:04:29 -04:00
tools Improve sys/catcache performance. 2017-10-13 14:22:41 -07:00
tutorial Distinguish selectivity of < from <= and > from >=. 2017-09-13 11:12:39 -04:00
.gitignore
DEVELOPERS
Makefile Remove redundant coverage target 2017-02-17 08:56:57 -05:00
Makefile.global.in Reinstate genhtml --prefix option for non-vpath builds 2017-10-14 11:44:45 -04:00
Makefile.shlib Remove support for bcc and msvc standalone libpq builds 2017-04-11 15:22:21 +02:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00