postgresql/src/backend
Andrew Gierth f7da492dca 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:38:33 +01:00
..
access Fix comment on when HOT update is possible. 2019-05-14 13:06:33 +03:00
bootstrap Message wording and pluralization improvements 2018-05-17 23:05:27 -04:00
catalog Fix style violations in syscache lookups. 2019-05-05 13:10:07 -04:00
commands Fix style violations in syscache lookups. 2019-05-05 13:10:07 -04:00
executor Fix array size allocation for HashAggregate hash keys. 2019-05-23 15:38:33 +01:00
foreign Remove bogus "extern" annotations on function definitions. 2018-02-19 12:07:44 -05:00
jit llvm: Fix file-ending in IDENTIFICATION comments. 2019-01-22 11:50:03 -08:00
lib Rename rbtree.c functions to use "rbt" prefix not "rb" prefix. 2018-11-06 13:25:24 -05:00
libpq Fix detection of passwords hashed with MD5 or SCRAM-SHA-256 2019-04-23 15:43:32 +09:00
main Update copyright for 2018 2018-01-02 23:30:12 -05:00
nodes Restructure creation of run-time pruning steps. 2019-05-17 19:44:19 -04:00
optimizer Repair issues with faulty generation of merge-append plans. 2019-05-09 16:52:49 -04:00
parser Fix backwards test in operator_precedence_warning logic. 2019-04-10 19:02:32 -04:00
partitioning Restructure creation of run-time pruning steps. 2019-05-17 19:44:19 -04:00
po Translation updates 2019-05-06 15:00:30 +02:00
port Cope with EINVAL and EIDRM shmat() failures in PGSharedMemoryAttach. 2019-05-10 14:56:41 -04:00
postmaster Rearrange pgstat_bestart() to avoid failures within its critical section. 2019-05-11 21:27:13 -04:00
regex Fix misoptimization of "{1,1}" quantifiers in regular expressions. 2019-05-12 18:53:40 -04:00
replication Fix logical replication's ideas about which type OIDs are built-in. 2019-05-13 17:23:00 -04:00
rewrite Perform RLS subquery checks as the right user when going via a view. 2019-04-02 08:17:04 +01:00
snowball Avoid unnecessary use of pg_strcasecmp for already-downcased identifiers. 2018-01-26 18:25:14 -05:00
statistics Fix typos. 2018-08-27 09:34:35 +12:00
storage Consistently test for in-use shared memory. 2019-04-12 22:36:42 -07:00
tcop Fix potential catalog corruption with temporary identity columns 2019-04-29 08:49:14 +02:00
tsearch Make ts_locale.c's character-type functions cope with UTF-16. 2018-11-03 13:56:10 -04:00
utils Fail pgwin32_message_to_UTF16() for SQL_ASCII messages. 2019-05-12 10:33:08 -07:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Rearrange makefile rules for running Gen_fmgrtab.pl. 2018-05-03 17:54:18 -04:00
nls.mk Translation updates 2018-09-17 08:40:36 +02:00