pgsql: Fix handling of NULLs when merging BRIN summaries

Поиск
Список
Период
Сортировка
От Tomas Vondra
Тема pgsql: Fix handling of NULLs when merging BRIN summaries
Дата
Msg-id E1pzlG7-000YoE-Ca@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix handling of NULLs when merging BRIN summaries

When merging BRIN summaries, union_tuples() did not correctly update the
target hasnulls/allnulls flags. When merging all-NULL summary into a
summary without any NULL values, the result had both flags set to false
(instead of having hasnulls=true).

This happened because the code only considered the hasnulls flags,
ignoring the possibility the source summary has allnulls=true.

Discovered while investigating issues with handling empty BRIN ranges
and handling of NULL values, but it's a separate problem (has nothing to
do with empty ranges).

Fixed by considering both flags on the source summary, and updating the
hasnulls flag on the target summary.

Backpatch to 11. The bug exists since 9.5 (where BRIN indexes were
introduced), but those releases are EOL already.

Discussion: https://postgr.es/m/9d993d0d-e431-2196-9ccc-0554d0e60154%40enterprisedb.com

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/80f64b90088a8aeae6aeace2d344c8116ec28061

Modified Files
--------------
src/backend/access/brin/brin.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)


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

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: pgsql: Fix handling of NULLs when merging BRIN summaries
Следующее
От: Tomas Vondra
Дата:
Сообщение: pgsql: Fix handling of NULLs when merging BRIN summaries