Fix harmless LC_COLLATE[_MASK] confusion.
authorThomas Munro <[email protected]>
Mon, 19 Aug 2024 09:21:03 +0000 (21:21 +1200)
committerThomas Munro <[email protected]>
Mon, 19 Aug 2024 10:21:24 +0000 (22:21 +1200)
Commit ca051d8b101 called newlocale(LC_COLLATE, ...) instead of
newlocale(LC_COLLATE_MASK, ...), in code reached only on FreeBSD.  They
have the same value on that OS, explaining why it worked.  Fix.

Back-patch to 14, where ca051d8b101 landed.

src/backend/utils/adt/pg_locale.c

index 99a21f20b9f933559b557662231206511b5344a5..cc28409956cbc822a6affc8aed5a34467118afce 100644 (file)
@@ -1683,7 +1683,7 @@ get_collation_actual_version(char collprovider, const char *collcollate)
        locale_t    loc;
 
        /* Look up FreeBSD collation version. */
-       loc = newlocale(LC_COLLATE, collcollate, NULL);
+       loc = newlocale(LC_COLLATE_MASK, collcollate, NULL);
        if (loc)
        {
            collversion =