aboutsummaryrefslogtreecommitdiff
path: root/contrib/pageinspect/gistfuncs.c
diff options
context:
space:
mode:
authorTomas Vondra <tomas.vondra@postgresql.org>2023-05-18 13:00:31 +0200
committerTomas Vondra <tomas.vondra@postgresql.org>2023-05-18 23:33:23 +0200
commit3ec8a3bfb5472ecf93aba416e9f384ea16d340d1 (patch)
tree2d9a9185bbef90c671f1ffe5e04fe8d1ffe99cd0 /contrib/pageinspect/gistfuncs.c
parent0791930aaaed2678daf694fa8b06cf81cd72cd69 (diff)
downloadpostgresql-3ec8a3bfb5472ecf93aba416e9f384ea16d340d1.tar.gz
postgresql-3ec8a3bfb5472ecf93aba416e9f384ea16d340d1.zip
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
Diffstat (limited to 'contrib/pageinspect/gistfuncs.c')
0 files changed, 0 insertions, 0 deletions