[17+] check after second call to pg_strnxfrm is too strict, relax it

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: [17+] check after second call to pg_strnxfrm is too strict, relax it
Date: 2024-07-30 19:31:24
Message-ID: 32f85d88d1f64395abfe5a10dd97a62a4d3474ce.camel@j-davis.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I noticed this comment in selfuncs.c regarding strxfrm():

/*
* Some systems (e.g., glibc) can return a smaller value from the
* second call than the first; thus the Assert must be <= not ==.
*/

Some callers of pg_strnxfrm() are not allowing for that possibility.

Patch attached, which should be backported to 17.

Regards,
Jeff Davis

Attachment Content-Type Size
0001-Relax-check-for-return-value-from-second-call-of-pg_.patch text/x-patch 3.6 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Laurenz Albe 2024-07-30 19:46:46 Re: proposal: schema variables
Previous Message Heikki Linnakangas 2024-07-30 19:24:57 Re: Minor refactorings to eliminate some static buffers