postgresql/src/backend
Andrew Gierth 44e95b5728 Fix array size allocation for HashAggregate hash keys.
When there were duplicate columns in the hash key list, the array
sizes could be miscomputed, resulting in access off the end of the
array. Adjust the computation to ensure the array is always large
enough.

(I considered whether the duplicates could be removed in planning, but
I can't rule out the possibility that duplicate columns might have
different hash functions assigned. Simpler to just make sure it works
at execution time regardless.)

Bug apparently introduced in fc4b3dea2 as part of narrowing down the
tuples stored in the hashtable. Reported by Colm McHugh of Salesforce,
though I didn't use their patch. Backpatch back to version 10 where
the bug was introduced.

Discussion: https://postgr.es/m/CAFeeJoKKu0u+A_A9R9316djW-YW3-+Gtgvy3ju655qRHR3jtdA@mail.gmail.com
2019-05-23 15:26:01 +01:00
..
access Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
bootstrap In bootstrap mode, use default signal handling for SIGINT etc. 2019-05-14 10:22:28 -04:00
catalog Initial pgperltidy run for v12. 2019-05-22 13:36:19 -04:00
commands Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
executor Fix array size allocation for HashAggregate hash keys. 2019-05-23 15:26:01 +01:00
foreign Update copyright for 2019 2019-01-02 12:44:25 -05:00
jit Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
lib Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
libpq Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
main Replace @postgresql.org with @lists.postgresql.org for mailinglists 2019-01-19 19:06:35 +01:00
nodes Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
optimizer Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
parser Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
partitioning Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
po Translation updates 2019-05-20 16:00:53 +02:00
port Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
postmaster Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
regex Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
replication Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
rewrite Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
snowball Update copyright for 2019 2019-01-02 12:44:25 -05:00
statistics Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
storage Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
tcop Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
tsearch Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
utils Initial pgperltidy run for v12. 2019-05-22 13:36:19 -04:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
Makefile Get rid of jsonpath_gram.h and jsonpath_scanner.h 2019-03-20 11:13:34 +03:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
nls.mk Translation updates 2019-05-20 16:00:53 +02:00