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

From Teodor Sigaev
Subject Re: regression test crashes at tsearch
Date
Msg-id 49A43C1D.6070106@sigaev.ru
Whole thread Raw
In response to Re: regression test crashes at tsearch  ("Hiroshi Saito" <z-saito@guitar.ocn.ne.jp>)
Responses Re: regression test crashes at tsearch  (Hiroshi Inoue <inoue@tpf.co.jp>)
List pgsql-hackers
> 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(), and char2wchar is called from single place: 
TParserInit. wchar2char isn't called at all. Next, regression tests are 
successfully passed until ispell_tst configuration was created. Looking at diff   SELECT to_tsquery('ispell_tst',
'footballyklubber:b& rebookings:A & sky');^M                                               to_tsquery
     ^M
 
! 
-----------------------------------------------------------------------------------------------------^M
!  'f':B & 'o':B & 'b':B & 'l':B & 'y':B & 'l':B & 'b':B & 'e':B & 'r':A & 'b':A 
& 'o':A & 'g':A & 'y'^M

I believe that even here parser is working correctly but there is problems in 
ispell.

So, although patch fixes the problem, it seems to me patch doesn't do it in 
right place. The patch converts multibyte string in non-utf encoding with 
C-locale into wide string by multibyte->utf8->wide conversation instead of 
pg_mb2wchar_with_len() call. Is output of pg_mb2wchar_with_len() compatible with 
isalpha (and others) functions?



-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
  WWW: http://www.sigaev.ru/
 


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Synchronous replication & Hot standby patches
Next
From: "Joshua D. Drake"
Date:
Subject: Re: Synchronous replication & Hot standby patches