Re: Inconsistent results with libc sorting on Windows

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Juan José Santamaría Flecha <juanjo(dot)santamaria(at)gmail(dot)com>
Cc: Peter Geoghegan <pg(at)bowt(dot)ie>, Daniel Verite <daniel(at)manitou-mail(dot)org>, Joe Conway <mail(at)joeconway(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Inconsistent results with libc sorting on Windows
Date: 2023-06-14 23:56:55
Message-ID: CA+hUKGJX4xeCy53qSyCF2zMUXJu5smFB9FORus8JqQhMkC=1Gw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jun 14, 2023 at 10:50 PM Juan José Santamaría Flecha
<juanjo(dot)santamaria(at)gmail(dot)com> wrote:
> Yes, I think the situation is quite similar to what you describe, with its WIN32 peculiarities. Take for example the attached program, it'll output:
>
> s1 = s2
> s2 = s3
> s1 > s3
> c1 > c2
> c2 > c3
> c1 > c3
>
> As you can see the test for CompareStringEx() is broken, but we get a sane answer with LCMapStringEx().

Given that the documented behaviour is that ".. the sort key produces
the same order as when the source string is used in CompareString or
CompareStringEx"[1], this seems like a reportable bug, unless perhaps
your test program is hiding an error with that default case you have.

[1] https://learn.microsoft.com/en-us/windows/win32/intl/handling-sorting-in-your-applications

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Dunstan 2023-06-14 23:57:31 Re: Do we want a hashset type?
Previous Message Thomas Munro 2023-06-14 23:20:30 Re: [17] collation provider "builtin"