postgresql/src
Tomas Vondra e858312683 Fix netmask handling in inet_minmax_multi_ops
When calculating distance in brin_minmax_multi_distance_inet(), the
netmask was applied incorrectly. This results in (seemingly) incorrect
ordering of values, triggering an assert.

For builds without asserts this is mostly harmless - we may merge other
ranges, possibly resulting in slightly less efficient index. But it's
still correct and the greedy algorithm doesn't guarantee optimality
anyway.

Backpatch to 14, where minmax-multi indexes were introduced.

Reported by Dmitry Dolgov, investigation and fix by me.

Reported-by: Dmitry Dolgov
Backpatch-through: 14
Discussion: https://postgr.es/m/17774-c6f3e36dd4471e67@postgresql.org
2023-03-20 10:24:14 +01:00
..
backend Fix netmask handling in inet_minmax_multi_ops 2023-03-20 10:24:14 +01:00
bin Simplify and speed up pg_dump's creation of parent-table links. 2023-03-17 13:43:10 -04:00
common Silence pedantic compiler warning introduced in ce340e530d 2023-03-16 09:41:13 -07:00
fe_utils Revert refactoring of restore command code to shell_restore.c 2023-02-06 08:28:42 +09:00
include Add functions to do timestamptz arithmetic in a non-default timezone. 2023-03-18 14:12:16 -04:00
interfaces libpq: Use modern socket flags, if available. 2023-03-17 20:40:34 +13:00
makefiles meson: Make auto the default of the ssl option 2023-03-13 07:04:11 +01:00
pl Break up long GETTEXT_FILES lists 2023-03-08 15:05:43 +01:00
port Use nanosleep() to implement pg_usleep(). 2023-03-15 17:57:12 +13:00
template Use unnamed POSIX semaphores on Cygwin. 2023-01-06 10:33:28 +13:00
test Fix netmask handling in inet_minmax_multi_ops 2023-03-20 10:24:14 +01:00
timezone Fix outdated references to guc.c 2023-03-02 13:49:39 +01:00
tools libpq: Remove code for SCM credential authentication 2023-03-17 10:52:26 +09:00
tutorial Remove useless casts to (void *) in arguments of some system functions 2023-02-07 06:57:59 +01:00
.gitignore
DEVELOPERS
Makefile Integrate pg_bsd_indent into our build/test infrastructure. 2023-02-12 12:22:21 -05:00
Makefile.global.in autoconf: Move export_dynamic determination to configure 2022-12-06 18:55:28 -08:00
Makefile.shlib autoconf: Rely on ar supporting index creation 2022-10-07 11:53:39 -07:00
meson.build Integrate pg_bsd_indent into our build/test infrastructure. 2023-02-12 12:22:21 -05:00
nls-global.mk Fix for make unportability 2022-07-13 09:15:01 +02:00