Skip site navigation (1) Skip section navigation (2)

Re: BUG #1931: ILIKE and LIKE fails on Turkish locale

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Devrim GUNDUZ <devrim(at)gunduz(dot)org>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1931: ILIKE and LIKE fails on Turkish locale
Date: 2006-06-14 21:00:13
Message-ID: 200606142100.k5EL0D820171@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-tr-genel
Did we make any progress on this?  If so, I can't find it.

---------------------------------------------------------------------------

Tom Lane wrote:
> "Devrim GUNDUZ" <devrim(at)gunduz(dot)org> writes:
> > http://sourceware.org/bugzilla/long_list.cgi?buglist=1354
> > So it is PostgreSQL's bug or Glibc's?
> 
> Just offhand, iwchareq() seems several bricks shy of a load:
> 
>     /*
>      * if one of them is an ASCII while the other is not, then they must
>      * be different characters
>      */
>     else if ((unsigned char) *p1 < CHARMAX || (unsigned char) *p2 < CHARMAX)
>         return (0);
> 
> This test is wrong per Jakub's observation.  Also, the code right below
> that is using tolower() not towlower() on wide characters, which seems
> pretty wrong.  For that matter, towlower would be wrong too :-( because
> there is no certainty that libc's idea of wide characters is the same as
> pg_mb2wchar_with_len's.
> 
> So yeah, ILIKE looks just about completely broken for multibyte encodings.
> Maybe it would be best to pass both strings through lower() and then
> do a normal LIKE comparison?
> 
> The regexp code doesn't look better, btw, just differently broken ...
> 
> 			regards, tom lane
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
> 
>                http://archives.postgresql.org
> 

-- 
  Bruce Momjian   http://candle.pha.pa.us
  EnterpriseDB    http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

In response to

Responses

pgsql-tr-genel by date

Next:From: Tom LaneDate: 2006-06-14 21:33:49
Subject: Re: BUG #1931: ILIKE and LIKE fails on Turkish locale
Previous:From: Adnan DURSUNDate: 2006-06-13 10:30:43
Subject: Re: Iki alani birlestirmede arama

pgsql-bugs by date

Next:From: Devrim GNDZDate: 2006-06-14 21:10:19
Subject: BUG #2479: Initdb fails on Turkish locale, on 7.4.13
Previous:From: Garima BajpaiDate: 2006-06-14 07:02:32
Subject: Unable to set priveleges of user

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group