Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 9649229

Browse files
committed
Treat {} as special regex too.
1 parent 08bcc77 commit 9649229

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/backend/parser/gram.y

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.80 1999/05/21 04:40:04 momjian Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.81 1999/05/21 15:47:13 momjian Exp $
1414
*
1515
* HISTORY
1616
* AUTHOR DATE MAJOR EVENT
@@ -5360,21 +5360,23 @@ static Node *makeIndexable(char *opname, Node *lexpr, Node *rexpr)
53605360
char *match_least = palloc(strlen(n->val.val.str)+2);
53615361
char *match_most = palloc(strlen(n->val.val.str)+2);
53625362
int pos, match_pos=0;
5363-
bool found_pipe = false;
5363+
bool found_special = false;
53645364

53655365
for (pos = 1; n->val.val.str[pos]; pos++)
53665366
{
5367-
if (n->val.val.str[pos] == '|')
5367+
if (n->val.val.str[pos] == '|' ||
5368+
if (n->val.val.str[pos] == '{' ||
5369+
if (n->val.val.str[pos] == '}')
53685370
{
5369-
found_pipe = true;
5371+
found_special = true;
53705372
break;
53715373
}
53725374
if (n->val.val.str[pos] == '\\')
53735375
pos++;
53745376
}
53755377

53765378
/* skip leading ^ */
5377-
if (!found_pipe)
5379+
if (!found_special)
53785380
{
53795381
for (pos = 1; n->val.val.str[pos]; pos++)
53805382
{

0 commit comments

Comments
 (0)