Re: [COMMITTERS] 'pgsql/src/backend/parser gram.y' - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [COMMITTERS] 'pgsql/src/backend/parser gram.y'
Date
Msg-id 24839.928767967@sss.pgh.pa.us
Whole thread Raw
In response to Re: [COMMITTERS] 'pgsql/src/backend/parser gram.y'  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [COMMITTERS] 'pgsql/src/backend/parser gram.y'
List pgsql-hackers
Bruce Momjian <maillist@candle.pha.pa.us> writes:
>> Repair recently-introduced error in makeIndexable for LIKE:
>> a non-leading % would be put into the >=/<= patterns.  Also, repair
>> longstanding confusion about whether %% means a literal %%.  The SQL92
>> doesn't say any such thing, and textlike() knows that, but gram.y didn't.

> Houston, we have a problem.  DoMatch has:

>             case '%':
>                 /* %% is the same as % according to the SQL standard */
>                 /* Advance past all %'s */
>                 while (*p == '%')

> Don't we want %% to be %?

I looked at the spec, and this piece of code is right: there is nothing
in the spec that says that %% means anything other than two string
pattern matches (which of course has the same effect as one).  So I made
gram.y agree.

It could be that people like Microsoft don't follow the spec... can
anyone check this?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] 6.6 items
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Bug in LIKE ?