postgresql/src
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
..
backend Prevent sharing transition states between ordered-set aggregates. 2017-10-11 22:18:10 -04:00
bin #ifdef out some dead code in psql/mainloop.c. 2017-10-06 11:35:55 -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 Temporary attempt at a workaround for further MSVC restrict build failures. 2017-10-11 19:06:29 -07: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 Remove "sco" and "unixware" ports. 2016-10-11 11:26:04 -04:00
test Prevent sharing transition states between ordered-set aggregates. 2017-10-11 22:18:10 -04:00
timezone Sync our copy of the timezone library with IANA tzcode master. 2017-09-22 00:04:29 -04:00
tools Enforce our convention about max number of parallel regression tests. 2017-10-07 17:20:09 -04: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 Support coverage on vpath builds 2017-10-06 11:39:46 -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