postgresql/src/backend
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
..
access Replace remaining uses of pq_sendint with pq_sendint{8,16,32}. 2017-10-11 21:00:46 -07:00
bootstrap Sync process names between ps and pg_stat_activity 2017-09-20 08:59:03 -04:00
catalog Explicitly track whether aggregate final functions modify transition state. 2017-10-14 15:21:39 -04:00
commands Rework DefineIndex relkind check 2017-10-16 12:22:18 +02:00
executor Repair breakage of aggregate FILTER option. 2017-10-16 15:24:36 -04:00
foreign Abstract logic to allow for multiple kinds of child rels. 2017-04-03 22:41:31 -04:00
lib Allow to avoid NUL-byte management for stringinfos and use in format.c. 2017-10-11 16:01:52 -07:00
libpq Attempt to fix LDAP build 2017-10-12 23:47:48 -04:00
main Change pg_ctl to detect server-ready by watching status in postmaster.pid. 2017-06-28 17:31:32 -04:00
nodes pg_stat_statements: Widen query IDs from 32 bits to 64 bits. 2017-10-11 19:52:46 -04:00
optimizer Fix possible crash with Parallel Bitmap Heap Scan. 2017-10-13 15:02:45 -04:00
parser Allow multiple tables to be specified in one VACUUM or ANALYZE command. 2017-10-03 18:53:44 -04:00
po Translation updates 2017-08-07 13:55:34 -04:00
port Change pg_ctl to detect server-ready by watching status in postmaster.pid. 2017-06-28 17:31:32 -04:00
postmaster Allow multiple tables to be specified in one VACUUM or ANALYZE command. 2017-10-03 18:53:44 -04:00
regex Mop-up for commit 85feb77aa0. 2017-09-22 11:35:12 -04:00
replication Replace remaining uses of pq_sendint with pq_sendint{8,16,32}. 2017-10-11 21:00:46 -07:00
rewrite Improve implementation of CRE-stack-flattening in map_variable_attnos(). 2017-10-13 13:43:55 -04:00
snowball Initial pgindent run with pg_bsd_indent version 2.0. 2017-06-21 14:39:04 -04:00
statistics Infer functional dependency past RelabelType 2017-10-12 17:23:47 +02:00
storage Remove unnecessary PG_TRY overhead for CurrentResourceOwner changes. 2017-10-11 17:44:09 -04:00
tcop Replace remaining uses of pq_sendint with pq_sendint{8,16,32}. 2017-10-11 21:00:46 -07:00
tsearch Mop-up for commit 85feb77aa0. 2017-09-22 11:35:12 -04:00
utils Improve sys/catcache performance. 2017-10-13 14:22:41 -07:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
Makefile Inject $(ICU_LIBS) regardless of platform. 2017-08-20 21:22:18 -07:00
common.mk Add ICU_CFLAGS to global CPPFLAGS 2017-06-12 15:57:22 -04:00
nls.mk Translation updates 2017-05-15 12:19:54 -04:00