Re: like/ilike improvements

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: andrew(at)supernews(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: like/ilike improvements
Date: 2007-05-23 14:52:44
Message-ID: 4654553C.9020708@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>
>> We should only be able to get out of step from the "%_" case, I believe,
>> so we should only need to do the first-byte test in that case (which is
>> in a different code path from the normal "_" case. Does that seem right?
>>
>
> At least put Assert(IsFirstByte()) in the main path.
>
> I'm a bit suspicious of the separate-path business anyway. Will it do
> the right thing with say "%%%_" ?
>
>
>

Yes:

/* %% is the same as % according to the SQL standard */
/* Advance past all %'s */
while ((plen > 0) && (*p == '%'))
NextByte(p, plen);

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2007-05-23 16:00:54 Re: like/ilike improvements
Previous Message Tom Lane 2007-05-23 14:41:09 Re: like/ilike improvements

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Dunstan 2007-05-23 16:00:54 Re: like/ilike improvements
Previous Message Tom Lane 2007-05-23 14:41:09 Re: like/ilike improvements