pgsql: Fix array size allocation for HashAggregate hash keys.

Поиск
Список
Период
Сортировка
От Andrew Gierth
Тема pgsql: Fix array size allocation for HashAggregate hash keys.
Дата
Msg-id E1hTp28-0002eA-C9@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/44e95b5728a4569c494fa4ea4317f8a2f50a206b

Modified Files
--------------
src/backend/executor/nodeAgg.c           | 29 ++++++++++++++++++++++-------
src/test/regress/expected/aggregates.out | 18 ++++++++++++++++++
src/test/regress/sql/aggregates.sql      |  7 +++++++
3 files changed, 47 insertions(+), 7 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: pgsql: Fix ordering of GRANT commands in pg_dumpall for tablespaces
Следующее
От: Andres Freund
Дата:
Сообщение: pgsql: pg_upgrade: Make test.sh's installcheck use to-be-upgradedversi