postgresql/src/backend/utils/sort
Thomas Munro ffcf6f4cfc Fix rare sharedtuplestore.c corruption.
If the final chunk of an oversized tuple being written out to disk was
exactly 32760 bytes, it would be corrupted due to a fencepost bug.

Bug #17619.  Back-patch to 11 where the code arrived.

While testing that (see test module in archives), I (tmunro) noticed
that the per-participant page counter was not initialized to zero as it
should have been; that wasn't a live bug when it was written since DSM
memory was originally always zeroed, but since 14
min_dynamic_shared_memory might be configured and it supplies non-zeroed
memory, so that is also fixed here.

Author: Dmitry Astapov <dastapov@gmail.com>
Discussion: https://postgr.es/m/17619-0de62ceda812b8b5%40postgresql.org
2023-01-26 14:52:19 +13:00
..
Makefile Split tuplesortvariants.c from tuplesort.c 2022-07-27 08:28:26 +03:00
logtape.c Fix and clarify function comment on LogicalTapeSetCreate. 2023-01-23 11:56:43 +02:00
meson.build Update copyright for 2023 2023-01-02 15:00:37 -05:00
qsort_interruptible.c Invent qsort_interruptible(). 2022-07-12 16:30:36 -04:00
sharedtuplestore.c Fix rare sharedtuplestore.c corruption. 2023-01-26 14:52:19 +13:00
sortsupport.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
tuplesort.c Remove redundant setting of tuplesort status 2023-01-09 16:53:21 +07:00
tuplesortvariants.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
tuplestore.c Add BufFileRead variants with short read and EOF detection 2023-01-16 11:01:31 +01:00