postgresql/src/backend
Tom Lane 52328727be Prevent sharing transition states between ordered-set aggregates.
This ought to work, but the built-in OSAs are not capable of coping,
because their final-functions destructively modify their transition
state (specifically, the contained tuplesort object).  That was fine
when those functions were written, but commit 804163bc2 moved the
goalposts without telling orderedsetaggs.c.

We should fix the built-in OSAs to support this, but it will take
a little work, especially if we don't want to sacrifice performance
in the normal non-shared-state case.  Given that it took a year after
9.6 release for anyone to notice this bug, we should not prioritize
sharable-state over nonsharable-state performance.  And a proper fix
is likely to be more complicated than we'd want to back-patch, too.

Therefore, let's just put in this stop-gap patch to prevent nodeAgg.c
from choosing to use shared state for OSAs.  We can revert it in HEAD
when we get a better fix.

Report from Lukas Eder, diagnosis by me, patch by David Rowley.
Back-patch to 9.6 where the problem was introduced.

Discussion: https://postgr.es/m/CAB4ELO5RZhOamuT9Xsf72ozbenDLLXZKSk07FiSVsuJNZB861A@mail.gmail.com
2017-10-11 22:18:10 -04:00
..
access Improve performance of SendRowDescriptionMessage. 2017-10-11 17:23:23 -07:00
bootstrap Sync process names between ps and pg_stat_activity 2017-09-20 08:59:03 -04:00
catalog Copy information from the relcache instead of pointing to it. 2017-10-06 15:28:07 -04:00
commands Remove unnecessary PG_TRY overhead for CurrentResourceOwner changes. 2017-10-11 17:44:09 -04:00
executor Prevent sharing transition states between ordered-set aggregates. 2017-10-11 22:18:10 -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 Add more efficient functions to pqformat API. 2017-10-11 16:01:52 -07: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 Reduce "X = X" to "X IS NOT NULL", if it's easy to do so. 2017-10-08 12:23:32 -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 Fix more user-visible elog() calls. 2017-10-05 07:58:02 -04:00
rewrite pg_stat_statements: Widen query IDs from 32 bits to 64 bits. 2017-10-11 19:52:46 -04:00
snowball Initial pgindent run with pg_bsd_indent version 2.0. 2017-06-21 14:39:04 -04:00
statistics Remove obsolete comments about functional dependencies 2017-07-26 11:40:39 -04:00
storage Remove unnecessary PG_TRY overhead for CurrentResourceOwner changes. 2017-10-11 17:44:09 -04:00
tcop Improve performance of SendRowDescriptionMessage. 2017-10-11 17:23:23 -07:00
tsearch Mop-up for commit 85feb77aa0. 2017-09-22 11:35:12 -04:00
utils Add more efficient functions to pqformat API. 2017-10-11 16:01:52 -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