Re: regression test crashes at tsearch - Mailing list pgsql-hackers

From Hiroshi Inoue
Subject Re: regression test crashes at tsearch
Date
Msg-id 49A4D61F.5060002@tpf.co.jp
Whole thread Raw
In response to Re: regression test crashes at tsearch  (Teodor Sigaev <teodor@sigaev.ru>)
Responses Re: regression test crashes at tsearch
List pgsql-hackers
Teodor Sigaev wrote:
>> I think that Mr. Inoue's patch is right.
>> why isn't it taken into consideration yet?
> 
> I can't check that patch because I don't have a Windows box.
> But I did some investigations. As I understand, the patch prevents from 
> calling of wcstombs/mbstowcs with C locale and I checked trace for that. 
> But wcstombs/mbstowcs doesn't called at all with C-locale.  With C 
> locale char2wchar calls pg_mb2wchar_with_len(), 

pg_mb2wchar_with_len() converts server encoded strings to pg_wchar
strings. But pg_wchar is typedef'd as unsigned int which is not the
same as wchar_t at least on Windows (unsigned short).
If pg_mb2wchar_with_len() works for wchar_t on Windows, we had better call it in all cases on Windows to implement
char2wchar().
> and char2wchar is called from single place: TParserInit.
> wchar2char isn't called at all.

I modified it corresponding to the change in char2wchar() so that
wchar2char(char2wchar(x)) becomes x. Though I'm not sure if it is
called or not, isn't it an principle?
If there's an effective function like pg_wchar2mb_with_len() which
converts wchar_t strings to server encoded strings, we had better
simply call it for char2wchar().

regards,
Hiroshi Inoue



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Service not starting: Error 1053
Next
From: "Lawrence, Ramon"
Date:
Subject: Re: Proposed Patch to Improve Performance of Multi-BatchHash Join for Skewed Data Sets