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

Jeff Davis <pgsql@j-davis.com>

From: Jeff Davis <pgsql@j-davis.com>
To: pgsql-hackers@postgresql.org
Date: 2024-07-30T19:31:24Z
Lists: pgsql-hackers

Attachments

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

Commits

  1. Relax check for return value from second call of pg_strnxfrm().