Re: Collation version tracking for macOS - Mailing list pgsql-hackers

From Dagfinn Ilmari Mannsåker
Subject Re: Collation version tracking for macOS
Date
Msg-id 87bkoni7hg.fsf@wibble.ilmari.org
Whole thread Raw
In response to Collation version tracking for macOS  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
List pgsql-hackers
Jeff Davis <pgsql@j-davis.com> writes:

> On Mon, 2022-11-28 at 19:36 -0800, Jeff Davis wrote:
>> On Mon, 2022-11-28 at 21:57 -0500, Robert Haas wrote:
>> > That is ... astonishingly bad.
>> 
>> https://unicode-org.atlassian.net/browse/CLDR-16175
>
> Oops, reported in CLDR instead of ICU. Moved to:
>
> https://unicode-org.atlassian.net/browse/ICU-22215

Out of morbid curiosity I went source diving, and the culprit is this
bit (which will also break if a version component ever goes above 999):

    /* write the decimal field value */
    field=versionArray[part];
    if(field>=100) {
        *versionString++=(char)('0'+field/100);
        field%=100;
    }
    if(field>=10) {
        *versionString++=(char)('0'+field/10);
        field%=10;
    }
    *versionString++=(char)('0'+field);

(https://sources.debian.org/src/icu/72.1-3/source/common/putil.cpp#L2308)

because apparently snprintf() is too hard?

- ilmari



pgsql-hackers by date:

Previous
From: Kazutaka Onishi
Date:
Subject: Re: Asynchronous execution support for Custom Scan
Next
From: Ronan Dunklau
Date:
Subject: Re: Asynchronous execution support for Custom Scan