postgresql/src/backend
David Rowley 3a5817695a Restrict Datum sort optimization to byval types only
91e9e89dc modified nodeSort.c so that it used datum sorts when the
targetlist of the outer node contained only a single column.  That commit
failed to recognise that the Datum returned by tuplesort_getdatum() must
be pfree'd when the type is a byref type.  Ronan Dunklau did originally
propose the patch with that restriction, but that, probably through my own
fault, got lost during further development work.

Due to the timing of this report (PG15 RC1 is almost out the door), let's
just restrict the datum sort optimization to apply for byval types only.
We might want to look harder into making this work for byref types in
PG16.

Reported-by: Önder Kalacı
Diagnosis-by: Tom Lane
Discussion: https://postgr.es/m/CACawEhVxe0ufR26UcqtU7GYGRuubq3p6ZWPGXL4cxy_uexpAAQ@mail.gmail.com
Backpatch-through: 15, where 91e9e89dc was introduced.
2022-09-29 11:43:00 +13:00
..
access Allow callback functions to deregister themselves during a call. 2022-09-28 11:23:27 -04:00
backup Revert 56-bit relfilenode change and follow-up commits. 2022-09-28 09:55:28 -04:00
bootstrap meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
catalog Change some errdetail() to errdetail_internal() 2022-09-28 17:14:53 +02:00
commands Change some errdetail() to errdetail_internal() 2022-09-28 17:14:53 +02:00
executor Restrict Datum sort optimization to byval types only 2022-09-29 11:43:00 +13:00
foreign meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
jit meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
lib meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
libpq meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
main meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
nodes Revert 56-bit relfilenode change and follow-up commits. 2022-09-28 09:55:28 -04:00
optimizer meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
parser Remove ALL keyword from TABLES IN SCHEMA for publication 2022-09-22 19:02:25 +02:00
partitioning meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
po meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
port meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
postmaster Message style improvements 2022-09-24 18:41:25 -04:00
regex Remove uses of register due to incompatibility with C++17 and up 2022-09-24 12:08:37 -07:00
replication Revert 56-bit relfilenode change and follow-up commits. 2022-09-28 09:55:28 -04:00
rewrite meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
snowball meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
statistics meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
storage Revert 56-bit relfilenode change and follow-up commits. 2022-09-28 09:55:28 -04:00
tcop Enable WRITE_READ_PARSE_PLAN_TREES of rewritten utility statements 2022-09-26 16:32:16 +02:00
tsearch Convert *GetDatum() and DatumGet*() macros to inline functions 2022-09-27 20:50:21 +02:00
utils Allow callback functions to deregister themselves during a call. 2022-09-28 11:23:27 -04:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
Makefile Move gramparse.h to src/backend/parser 2022-09-14 10:57:13 +07:00
common.mk Blind attempt to fix LLVM dependency in the backend 2022-09-15 10:53:48 +07:00
meson.build meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
nls.mk NLS: Put list of available languages into LINGUAS files 2022-07-13 08:19:17 +02:00