pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix handling of NULLs when merging BRIN summaries 6+ messages / 1 participants [nested] [flat]
* pgsql: Fix handling of NULLs when merging BRIN summaries @ 2023-05-18 21:33 Tomas Vondra <tomas.vondra@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Tomas Vondra @ 2023-05-18 21:33 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 ------ master Details ------- https://git.postgresql.org/pg/commitdiff/3ec8a3bfb5472ecf93aba416e9f384ea16d340d1 Modified Files -------------- src/backend/access/brin/brin.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix handling of NULLs when merging BRIN summaries @ 2023-05-18 21:34 Tomas Vondra <tomas.vondra@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Tomas Vondra @ 2023-05-18 21:34 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix handling of NULLs when merging BRIN summaries @ 2023-05-18 21:34 Tomas Vondra <tomas.vondra@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Tomas Vondra @ 2023-05-18 21:34 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/3f1356e5d60a310b9ceb73497ec49af1b69bafa8 Modified Files -------------- src/backend/access/brin/brin.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix handling of NULLs when merging BRIN summaries @ 2023-05-18 21:34 Tomas Vondra <tomas.vondra@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Tomas Vondra @ 2023-05-18 21:34 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/2b1ab28b9dc9226b8a87cf8886ac3aebe591ac9a Modified Files -------------- src/backend/access/brin/brin_inclusion.c | 10 +++++++++- src/backend/access/brin/brin_minmax.c | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix handling of NULLs when merging BRIN summaries @ 2023-05-18 21:35 Tomas Vondra <tomas.vondra@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Tomas Vondra @ 2023-05-18 21:35 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/d42ffda685f5dbd123df59c2f8050e8fb09164c7 Modified Files -------------- src/backend/access/brin/brin_inclusion.c | 10 +++++++++- src/backend/access/brin/brin_minmax.c | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix handling of NULLs when merging BRIN summaries @ 2023-05-18 21:35 Tomas Vondra <tomas.vondra@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Tomas Vondra @ 2023-05-18 21:35 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/b511d7323df605fbb97ac8f158801cf53b028e41 Modified Files -------------- src/backend/access/brin/brin_inclusion.c | 10 +++++++++- src/backend/access/brin/brin_minmax.c | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2023-05-18 21:35 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2023-05-18 21:33 pgsql: Fix handling of NULLs when merging BRIN summaries Tomas Vondra <tomas.vondra@postgresql.org> 2023-05-18 21:34 pgsql: Fix handling of NULLs when merging BRIN summaries Tomas Vondra <tomas.vondra@postgresql.org> 2023-05-18 21:34 pgsql: Fix handling of NULLs when merging BRIN summaries Tomas Vondra <tomas.vondra@postgresql.org> 2023-05-18 21:34 pgsql: Fix handling of NULLs when merging BRIN summaries Tomas Vondra <tomas.vondra@postgresql.org> 2023-05-18 21:35 pgsql: Fix handling of NULLs when merging BRIN summaries Tomas Vondra <tomas.vondra@postgresql.org> 2023-05-18 21:35 pgsql: Fix handling of NULLs when merging BRIN summaries Tomas Vondra <tomas.vondra@postgresql.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox