Re: BUG #5478: ILIKE operator returns wrong result - Mailing list pgsql-bugs

From Bruce Momjian
Subject Re: BUG #5478: ILIKE operator returns wrong result
Date
Msg-id 201005281455.o4SEtQf18738@momjian.us
Whole thread Raw
In response to Re: BUG #5478: ILIKE operator returns wrong result  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #5478: ILIKE operator returns wrong result  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Tom Lane wrote:
> "Markus" <markus.herven@outpost24.com> writes:
> > select 'ba' ilike '%__%';
> > return true as expected in 8.2 but false in 8.4.
>
> I have a feeling that this represents still another bug in the
> special-case path for % followed by _ (cf bug #4821).  If so,
> maybe we ought to just toss out that optimization?

Yea, looks like it is this code in like_match.c:

    /* %_ is the same as _% - avoid matching _ repeatedly */

    do
    {
        NextChar(t, tlen);
        NextByte(p, plen);
    } while (tlen > 0 && plen > 0 && *p == '_');

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #5477: CREATE DOMAIN NOT NULL constraints not always enforced for INSERT with subquery
Next
From: Tom Lane
Date:
Subject: Re: BUG #5478: ILIKE operator returns wrong result