diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2017-06-16 10:08:54 -0400 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2017-06-16 10:08:54 -0400 |
commit | 41839b7abc85f21dd7ce76ab9cd1d7533c53cf9c (patch) | |
tree | a82b7f764fbb5854209e980a15777b70b29f341b | |
parent | 3ef97e725e2cbb050ff2e88adc36299bafa188c4 (diff) | |
download | postgresql-41839b7abc85f21dd7ce76ab9cd1d7533c53cf9c.tar.gz postgresql-41839b7abc85f21dd7ce76ab9cd1d7533c53cf9c.zip |
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>
-rw-r--r-- | src/backend/utils/adt/varlena.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c index a0dd391f092..a21c6899596 100644 --- a/src/backend/utils/adt/varlena.c +++ b/src/backend/utils/adt/varlena.c @@ -1433,7 +1433,8 @@ varstr_cmp(char *arg1, int len1, char *arg2, int len2, Oid collid) #ifdef WIN32 /* Win32 does not have UTF-8, so we need to map to UTF-16 */ - if (GetDatabaseEncoding() == PG_UTF8) + if (GetDatabaseEncoding() == PG_UTF8 + && (!mylocale || mylocale->provider == COLLPROVIDER_LIBC)) { int a1len; int a2len; |