Skip to content

Commit 41839b7

Browse files
committed
Fix ICU collation use on Windows
Windows uses a separate code path for libc locales. The code previously ended up there also if an ICU collation should be used, leading to a crash. Reported-by: Ashutosh Sharma <ashu.coek88@gmail.com>
1 parent 3ef97e7 commit 41839b7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/backend/utils/adt/varlena.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1433,7 +1433,8 @@ varstr_cmp(char *arg1, int len1, char *arg2, int len2, Oid collid)
14331433

14341434
#ifdef WIN32
14351435
/* Win32 does not have UTF-8, so we need to map to UTF-16 */
1436-
if (GetDatabaseEncoding() == PG_UTF8)
1436+
if (GetDatabaseEncoding() == PG_UTF8
1437+
&& (!mylocale || mylocale->provider == COLLPROVIDER_LIBC))
14371438
{
14381439
int a1len;
14391440
int a2len;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy