Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9649229

Browse files
committed
Treat {} as special regex too.
1 parent08bcc77 commit9649229

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/2104:40:04 momjian Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.81 1999/05/2115:47:13 momjian Exp $
1414
*
1515
* HISTORY
1616
* AUTHORDATEMAJOR 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-
boolfound_pipe = false;
5363+
boolfound_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)

[8]ページ先頭

©2009-2025 Movatter.jp