Re: Clear up strxfrm() in UTF-8 with locale on Windows - Mailing list pgsql-patches

From Hiroshi Saito
Subject Re: Clear up strxfrm() in UTF-8 with locale on Windows
Date
Msg-id 04d101c77aa9$fc7164e0$c701a8c0@wiseknot.local
Whole thread Raw
In response to Clear up strxfrm() in UTF-8 with locale on Windows  (ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp>)
List pgsql-patches
From: "ITAGAKI Takahiro" <itagaki.takahiro@oss.ntt.co.jp>

> The attached patch clears up the usage of strxfrm() on Windows. If the
> server encoding is UTF-8 and the locale is not C, we should use wcsxfrm()
> instead of strxfrm() because UTF-8 locale are not supported on Windows.
> We've already have a special version of strcoll() for Windows, but the
> usage of strxfrm() was still broken.
>
> When we are caught up in the bug, we see the next error message.
> | ERROR:  invalid memory alloc request size 2147483648
> If the server is wrong configured between the server encoding and the
> locale, strxfrm() could be failed and return values like INT_MAX or
> (size_t)-1. We've passed the result+1 straight to palloc(), so the server
> tried to allocale more than 1GB of memory and gave up.

Ahh..., Certainly, the bug lurked there. probably, your patch will help it.
It was not pursued in Japan for the reasons that the locale had been
recommended to be used by C up to now. however, It seems to have
caused the user's confusion. In that sense, I vote.+1

But, I am skeptic the locale setting still functions correctly.

However, I think it is great work.:-)

Thanks.

Regards,
Hiroshi Saito



pgsql-patches by date:

Previous
From: ITAGAKI Takahiro
Date:
Subject: Re: autovacuum multiworkers, patch 5
Next
From: Bruce Momjian
Date:
Subject: Re: Minor recovery changes