1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-12 05:01:15 +03:00

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.
This commit is contained in:
Tom Lane
1999-06-07 14:28:26 +00:00
parent 43c135e351
commit bad3b3068d
2 changed files with 29 additions and 14 deletions

View File

@@ -111,7 +111,7 @@ textnlike(struct varlena * s, struct varlena * p)
}
/* $Revision: 1.24 $
/* $Revision: 1.25 $
** "like.c" A first attempt at a LIKE operator for Postgres95.
**
** Originally written by Rich $alz, mirror!rs, Wed Nov 26 19:03:17 EST 1986.
@@ -191,7 +191,9 @@ DoMatch(pg_wchar * text, pg_wchar * p)
else
{
/* End of input string. Do we have matching string remaining? */
if (p[0] == '\0' || (p[0] == '%' && p[1] == '\0'))
while (*p == '%') /* allow multiple %'s at end of pattern */
p++;
if (*p == '\0')
return LIKE_TRUE;
else
return LIKE_ABORT;