pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedpgsql: Fix netmask handling in inet_minmax_multi_ops
5+ messages / 3 participants
[nested] [flat]
* pgsql: Fix netmask handling in inet_minmax_multi_ops
@ 2023-03-20 09:28 Tomas Vondra <tomas.vondra@postgresql.org>
2023-03-26 16:48 ` Re: pgsql: Fix netmask handling in inet_minmax_multi_ops Tomas Vondra <tomas.vondra@enterprisedb.com>
0 siblings, 1 reply; 5+ messages in thread
From: Tomas Vondra @ 2023-03-20 09:28 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
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
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/e8583126833a53f4eebe28a8de45d128f01ff664
Modified Files
--------------
src/backend/access/brin/brin_minmax_multi.c | 4 ++--
src/test/regress/expected/brin_multi.out | 6 ++++++
src/test/regress/sql/brin_multi.sql | 7 +++++++
3 files changed, 15 insertions(+), 2 deletions(-)
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: pgsql: Fix netmask handling in inet_minmax_multi_ops
2023-03-20 09:28 pgsql: Fix netmask handling in inet_minmax_multi_ops Tomas Vondra <tomas.vondra@postgresql.org>
@ 2023-03-26 16:48 ` Tomas Vondra <tomas.vondra@enterprisedb.com>
2023-03-26 17:46 ` Re: pgsql: Fix netmask handling in inet_minmax_multi_ops Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 5+ messages in thread
From: Tomas Vondra @ 2023-03-26 16:48 UTC (permalink / raw)
To: Tomas Vondra <tomas.vondra@postgresql.org>; pgsql-committers@lists.postgresql.org
On 3/20/23 10:28, Tomas Vondra wrote:
> 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
Correction - the issue was reported by Robins Tharakan, I got confused
while writing the commit message. I don't know if this issue is to be
mentioned in release notes (considering it mostly affects just assert
builds), but if we do we should the correct name.
regards
--
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: pgsql: Fix netmask handling in inet_minmax_multi_ops
2023-03-20 09:28 pgsql: Fix netmask handling in inet_minmax_multi_ops Tomas Vondra <tomas.vondra@postgresql.org>
2023-03-26 16:48 ` Re: pgsql: Fix netmask handling in inet_minmax_multi_ops Tomas Vondra <tomas.vondra@enterprisedb.com>
@ 2023-03-26 17:46 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 5+ messages in thread
From: Tom Lane @ 2023-03-26 17:46 UTC (permalink / raw)
To: Tomas Vondra <tomas.vondra@enterprisedb.com>; +Cc: pgsql-committers@lists.postgresql.org
Tomas Vondra <tomas.vondra@enterprisedb.com> writes:
> On 3/20/23 10:28, Tomas Vondra wrote:
>> Reported by Dmitry Dolgov, investigation and fix by me.
>> Reported-by: Dmitry Dolgov
> Correction - the issue was reported by Robins Tharakan, I got confused
> while writing the commit message. I don't know if this issue is to be
> mentioned in release notes (considering it mostly affects just assert
> builds), but if we do we should the correct name.
We don't normally cite the bug reporter's name in release notes,
just the person(s) who wrote the patch. So this won't be an issue
for the notes.
regards, tom lane
^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Fix netmask handling in inet_minmax_multi_ops
@ 2023-03-20 09:28 Tomas Vondra <tomas.vondra@postgresql.org>
0 siblings, 0 replies; 5+ messages in thread
From: Tomas Vondra @ 2023-03-20 09:28 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
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
Branch
------
REL_15_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/0c7726c2827e3ff685c460acd757a4b0c7ee09f7
Modified Files
--------------
src/backend/access/brin/brin_minmax_multi.c | 4 ++--
src/test/regress/expected/brin_multi.out | 6 ++++++
src/test/regress/sql/brin_multi.sql | 7 +++++++
3 files changed, 15 insertions(+), 2 deletions(-)
^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Fix netmask handling in inet_minmax_multi_ops
@ 2023-03-20 09:29 Tomas Vondra <tomas.vondra@postgresql.org>
0 siblings, 0 replies; 5+ messages in thread
From: Tomas Vondra @ 2023-03-20 09:29 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
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
Branch
------
REL_14_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/6a78a42fea0c457dfee2a5ac5431df02342eafd2
Modified Files
--------------
src/backend/access/brin/brin_minmax_multi.c | 4 ++--
src/test/regress/expected/brin_multi.out | 6 ++++++
src/test/regress/sql/brin_multi.sql | 7 +++++++
3 files changed, 15 insertions(+), 2 deletions(-)
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2023-03-26 17:46 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-03-20 09:28 pgsql: Fix netmask handling in inet_minmax_multi_ops Tomas Vondra <tomas.vondra@postgresql.org>
2023-03-26 16:48 ` Tomas Vondra <tomas.vondra@enterprisedb.com>
2023-03-26 17:46 ` Tom Lane <tgl@sss.pgh.pa.us>
2023-03-20 09:28 pgsql: Fix netmask handling in inet_minmax_multi_ops Tomas Vondra <tomas.vondra@postgresql.org>
2023-03-20 09:29 pgsql: Fix netmask handling in inet_minmax_multi_ops 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