pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix order of parameters in BRIN minmax-multi calls
Date: Sun, 04 Apr 2021 17:26:38 +0000
Message-ID: <E1lT6WE-00040P-4k@gemulon.postgresql.org> (raw)

Fix order of parameters in BRIN minmax-multi calls

The BRIN minmax-multi consistent function incorrectly assumed it can
lookup an operator, and then swap the arguments to get the commutator.
For example <(a,b) would be called as <(b,a) to get >(a,b). This works
when the arguments are of the same type, but with cross-type opclasses
this fails. We can't swap <(float4,float8) arguments, for example.

Fixed by passing arguments in the right order.

Discussion: https://postgr.es/m/CAJKUy5jLZFLCxyxfT%3DMfK5mtPfSzHA1rVLowR-j4RRsFVvKm7A%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1dad2a5ea3d14dd205603c31cc94ec088183ab2a

Modified Files
--------------
src/backend/access/brin/brin_minmax_multi.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)



Message-ID: <E1lT6WE-00040P-4k@gemulon.postgresql.org>
Permalink:  ../E1lT6WE-00040P-4k@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lT6WE-00040P-4k@gemulon.postgresql.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tomas.vondra@postgresql.org
  Subject: Re: pgsql: Fix order of parameters in BRIN minmax-multi calls
  In-Reply-To: <E1lT6WE-00040P-4k@gemulon.postgresql.org>
  References: <E1lT6WE-00040P-4k@gemulon.postgresql.org>

* 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