Re: like/ilike improvements - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: like/ilike improvements
Date
Msg-id 4654553C.9020708@dunslane.net
Whole thread Raw
In response to Re: like/ilike improvements  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: like/ilike improvements  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers

Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.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




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: like/ilike improvements
Next
From: Andrew Dunstan
Date:
Subject: Re: like/ilike improvements