On 25/08/2026 11:13, Heikki Linnakangas wrote:
/*
 * Expansion factor of string length, not including terminating NUL. That is,  * the upper bound of the number of multibyte characters in the result string
 * per multibyte character in the input string.
 *
 * NB: assumes no provider exceeds the Unicode-defined maximum.
 */
#define PG_MAX_CASEMAP_MBCHARS        UNICODE_MAX_CASEMAP_CODEPOINTS

Is it a number of codepoints or bytes? The comment says "multibyte characters" which I think means codepoints in unicode, but the ltree code does this:

        /* max space required to map single codepoint, including NUL */
        char        foldstr[PG_CASEMAP_BUFSZ];

Which sure looks like # of bytes.

Never mind. Just after sending this I saw that PG_CASEMAP_BUFSZ is different from PG_MAX_CASEMAP_MBCHARS. Sorry for the noise.

- Heikki



Reply via email to