Re: CLUSTER sort on abbreviated expressions is broken - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: CLUSTER sort on abbreviated expressions is broken
Date
Msg-id CAH2-Wzk9qO=zfRgwM4p19hQ=+fMij5hXHwtBWHmBCnws=9WKdw@mail.gmail.com
Whole thread Raw
In response to Re: CLUSTER sort on abbreviated expressions is broken  (Thomas Munro <thomas.munro@gmail.com>)
Responses Re: CLUSTER sort on abbreviated expressions is broken
List pgsql-hackers
On Sun, Apr 3, 2022 at 4:34 PM Thomas Munro <thomas.munro@gmail.com> wrote:
> I probably should have made it clearer in the commit message,
> cc58eecc5 doesn't fix this problem in the master branch.  It only
> fixes the code that incorrectly assumed that datum1 was always
> available.

Attached patch fixes the issue, and includes the test case that you posted.

There is only a one line change to tuplesort.c. This is arguably the
same bug -- abbreviation is just another "haveDatum1 optimization"
that needs to be accounted for.

-- 
Peter Geoghegan

Attachment

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: make MaxBackends available in _PG_init
Next
From: Nathan Bossart
Date:
Subject: Re: make MaxBackends available in _PG_init