pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: Tomas Vondra <tomas.vondra@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Fix netmask handling in inet_minmax_multi_ops
Date: Sun, 26 Mar 2023 18:48:45 +0200
Message-ID: <200b709d-6b1d-54e6-971d-b9dec75bd8a8@enterprisedb.com> (raw)
In-Reply-To: <E1peBoh-004SQd-AM@gemulon.postgresql.org>
References: <E1peBoh-004SQd-AM@gemulon.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





view thread (5+ messages)  latest in thread

Message-ID: <200b709d-6b1d-54e6-971d-b9dec75bd8a8@enterprisedb.com>
Permalink:  ../200b709d-6b1d-54e6-971d-b9dec75bd8a8@enterprisedb.com/
Also on:    postgresql.org/message-id/200b709d-6b1d-54e6-971d-b9dec75bd8a8@enterprisedb.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tomas.vondra@enterprisedb.com, tomas.vondra@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix netmask handling in inet_minmax_multi_ops
  In-Reply-To: <200b709d-6b1d-54e6-971d-b9dec75bd8a8@enterprisedb.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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