pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Arthur Zakirov <a.zakirov@postgrespro.ru>
To: Daniel Verite <daniel@manitou-mail.org>
To: James Inform <james.inform@pharmapp.de>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15892: URGENT: Using an ICU collation in a primary key column breaks ILIKE query
Date: Thu, 4 Jul 2019 20:57:19 +0300
Message-ID: <94c64652-81f6-63b9-b86c-bfc23d5d41d9@postgrespro.ru> (raw)
In-Reply-To: <8be770db-3fd9-428a-968e-333fc67a50db@manitou-mail.org>
References: <8be770db-3fd9-428a-968e-333fc67a50db@manitou-mail.org>

On 04.07.2019 19:50, Daniel Verite wrote:
> Yes. It is because of the index that the code checks if the ILIKE
> can be evaluated with an index lookup. Otherwise it doesn't.
> 
> If you feel like recompiling with a temporary fix against v11.4 to do
> your own tests, please try the attached patch.

Also this patch works. I thinks we need to use some ICU function to 
check whether a char is a letter.

-- 
Arthur Zakirov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company

Attachments:

fix-selfuncs-ilike-v2.patch (text/x-patch, 740B) download diff --git a/src/backend/utils/adt/like_support.c b/src/backend/utils/adt/like_support.c index 26e0634833..6a8c360209 100644 --- a/src/backend/utils/adt/like_support.c +++ b/src/backend/utils/adt/like_support.c @@ -1449,7 +1449,14 @@ pattern_char_isalpha(char c, bool is_multibyte, else if (is_multibyte && IS_HIGHBIT_SET(c)) return true; else if (locale && locale->provider == COLLPROVIDER_ICU) - return IS_HIGHBIT_SET(c) ? true : false; + { +#ifdef USE_ICU + return u_isalpha(c); +#else + /* shouldn't happen */ + elog(ERROR, "unsupported collprovider: %c", locale->provider); +#endif + } #ifdef HAVE_LOCALE_T else if (locale && locale->provider == COLLPROVIDER_LIBC) return isalpha_l((unsigned char) c, locale->info.lt);

view thread (9+ messages)  latest in thread

Message-ID: <94c64652-81f6-63b9-b86c-bfc23d5d41d9@postgrespro.ru>
Permalink:  ../94c64652-81f6-63b9-b86c-bfc23d5d41d9@postgrespro.ru/
Also on:    postgresql.org/message-id/94c64652-81f6-63b9-b86c-bfc23d5d41d9@postgrespro.ru

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: a.zakirov@postgrespro.ru, daniel@manitou-mail.org, james.inform@pharmapp.de
  Subject: Re: BUG #15892: URGENT: Using an ICU collation in a primary key column breaks ILIKE query
  In-Reply-To: <94c64652-81f6-63b9-b86c-bfc23d5d41d9@postgrespro.ru>
  References: <8be770db-3fd9-428a-968e-333fc67a50db@manitou-mail.org> <94c64652-81f6-63b9-b86c-bfc23d5d41d9@postgrespro.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox