Commit 2d87654a authored by Thomas G. Lockhart's avatar Thomas G. Lockhart

Repair "LIKE" behavior with two adjacent wildcard characters ("_").

 Was ignoring second wildcard.
parent a540f786
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.5 1998/02/25 13:07:08 scrappy Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.6 1998/03/07 06:04:59 thomas Exp $
* *
* HISTORY * HISTORY
* AUTHOR DATE MAJOR EVENT * AUTHOR DATE MAJOR EVENT
...@@ -4835,15 +4835,16 @@ static Node *makeIndexable(char *opname, Node *lexpr, Node *rexpr) ...@@ -4835,15 +4835,16 @@ static Node *makeIndexable(char *opname, Node *lexpr, Node *rexpr)
for (pos = 0; n->val.val.str[pos]; pos++) for (pos = 0; n->val.val.str[pos]; pos++)
{ {
if ((n->val.val.str[pos] == '%' && if (n->val.val.str[pos] == '%' &&
n->val.val.str[pos+1] != '%') || n->val.val.str[pos+1] != '%')
(n->val.val.str[pos] == '_' &&
n->val.val.str[pos+1] != '_'))
break; break;
if (n->val.val.str[pos] == '%' || if(n->val.val.str[pos] == '_')
n->val.val.str[pos] == '_' || break;
n->val.val.str[pos] == '\\') if (n->val.val.str[pos] == '\\' ||
n->val.val.str[pos] == '%')
pos++; pos++;
if (n->val.val.str[pos] == '\0')
break;
match_least[match_pos] = n->val.val.str[pos]; match_least[match_pos] = n->val.val.str[pos];
match_most[match_pos++] = n->val.val.str[pos]; match_most[match_pos++] = n->val.val.str[pos];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment