Re: [HACKERS] Bug in LIKE ?

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Daniele Orlandi <daniele(at)orlandi(dot)com>, The Hermit Hacker <scrappy(at)hub(dot)org>, pgsql-hackers(at)hub(dot)org
Subject: Re: [HACKERS] Bug in LIKE ?
Date: 1999-06-07 14:26:30
Message-ID: 199906071426.KAA04794@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Daniele Orlandi <daniele(at)orlandi(dot)com> writes:
> > Uhm.... I think the problem is a little worse:
>
> It's a real bug, and I see the problem: someone changed the handling of
> LIKE prefixes in gram.y, without understanding quite what they were
> doing. 6.4.2 has:
>
> if (n->val.val.str[pos] == '\\' ||
> n->val.val.str[pos] == '%')
> pos++;
>
> where 6.5 has:
>
> if (n->val.val.str[pos] == '\\' ||
> n->val.val.str[pos+1] == '%')
> pos++;
>
> The first one is right and the second is not.
>
> Unless we fix this, LIKE will be completely busted for any string
> containing non-leading %. Shall I ... ?

Yes, please. It was me that introduced the bug.

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-06-07 14:28:52 Re: [HACKERS] Bug in LIKE ?
Previous Message The Hermit Hacker 1999-06-07 14:15:51 Re: [HACKERS] Open 6.5 items