Re: regression test crashes at tsearch

From: Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp>
To: Teodor Sigaev <teodor(at)sigaev(dot)ru>
Cc: Hiroshi Saito <z-saito(at)guitar(dot)ocn(dot)ne(dot)jp>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: regression test crashes at tsearch
Date: 2009-02-25 05:24:47
Message-ID: 49A4D61F.5060002@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Lawrence, Ramon 2009-02-25 05:38:40 Re: Proposed Patch to Improve Performance of Multi-BatchHash Join for Skewed Data Sets
Previous Message Tom Lane 2009-02-25 04:51:04 Re: Service not starting: Error 1053