Thread: pgsql: Fix arrays comparison in CompareOpclassOptions()

pgsql: Fix arrays comparison in CompareOpclassOptions()

From
Alexander Korotkov
Date:
Fix arrays comparison in CompareOpclassOptions()

The current code calls array_eq() and does not provide FmgrInfo.  This commit
provides initialization of FmgrInfo and uses C collation as the safe option
for text comparison because we don't know anything about the semantics of
opclass options.

Backpatch to 13, where opclass options were introduced.

Reported-by: Nicolas Maus
Discussion: https://postgr.es/m/18692-72ea398df3ec6712%40postgresql.org
Backpatch-through: 13

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a6fa869cfa4e8f0226f22f717f5b0aa5eed60588

Modified Files
--------------
contrib/pg_trgm/expected/pg_trgm.out |  3 +++
contrib/pg_trgm/sql/pg_trgm.sql      |  4 ++++
src/backend/commands/indexcmds.c     | 11 +++++++++--
3 files changed, 16 insertions(+), 2 deletions(-)


Re: pgsql: Fix arrays comparison in CompareOpclassOptions()

From
Tom Lane
Date:
Alexander Korotkov <akorotkov@postgresql.org> writes:
> Fix arrays comparison in CompareOpclassOptions()

Umm ... you do realize we're still in release freeze?

https://wiki.postgresql.org/wiki/Committing_checklist#Release_freezes

Hopefully it will not make a difference, but this really should
have waited another day.

            regards, tom lane



Re: pgsql: Fix arrays comparison in CompareOpclassOptions()

From
Alexander Korotkov
Date:
On Tue, Nov 12, 2024 at 2:09 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Alexander Korotkov <akorotkov@postgresql.org> writes:
> > Fix arrays comparison in CompareOpclassOptions()
>
> Umm ... you do realize we're still in release freeze?
>
> https://wiki.postgresql.org/wiki/Committing_checklist#Release_freezes
>
> Hopefully it will not make a difference, but this really should
> have waited another day.

Oh, I specially visited the wiki page, but misread the sentence on
when the release freeze stops.  Obviously yes, tags aren't pushed,
that are just stamps.  And that's not February 13th.
Sorry for this.  Let me know if I can do something to fix this.

------
Regards,
Alexander Korotkov
Supabase



Re: pgsql: Fix arrays comparison in CompareOpclassOptions()

From
Tom Lane
Date:
Alexander Korotkov <aekorotkov@gmail.com> writes:
> On Tue, Nov 12, 2024 at 2:09 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Umm ... you do realize we're still in release freeze?

> Oh, I specially visited the wiki page, but misread the sentence on
> when the release freeze stops.  Obviously yes, tags aren't pushed,
> that are just stamps.  And that's not February 13th.
> Sorry for this.  Let me know if I can do something to fix this.

Well, unless we need a re-wrap due to packager complaints, it
won't make a difference.  If we do need a re-wrap, we'll have
to decide whether to temporarily revert this or to include it
in the re-wrapped versions.  The patch looks safe enough that
probably including it would be okay ... but that was not the
plan.

I don't feel a need to make a decision about that unless it
becomes necessary, though.

            regards, tom lane



Re: pgsql: Fix arrays comparison in CompareOpclassOptions()

From
Alexander Korotkov
Date:
On Tue, Nov 12, 2024 at 3:10 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Alexander Korotkov <aekorotkov@gmail.com> writes:
> > On Tue, Nov 12, 2024 at 2:09 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> >> Umm ... you do realize we're still in release freeze?
>
> > Oh, I specially visited the wiki page, but misread the sentence on
> > when the release freeze stops.  Obviously yes, tags aren't pushed,
> > that are just stamps.  And that's not February 13th.
> > Sorry for this.  Let me know if I can do something to fix this.
>
> Well, unless we need a re-wrap due to packager complaints, it
> won't make a difference.  If we do need a re-wrap, we'll have
> to decide whether to temporarily revert this or to include it
> in the re-wrapped versions.  The patch looks safe enough that
> probably including it would be okay ... but that was not the
> plan.
>
> I don't feel a need to make a decision about that unless it
> becomes necessary, though.

Thank you.  I'm up to revert if needed.

------
Regards,
Alexander Korotkov
Supabase