Skip to content

Commit 86f0812

Browse files
committed
Remove special treatment of '|' operator, in the spirit of "sane" binary
operators.
1 parent 525e1c4 commit 86f0812

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

src/backend/parser/gram.y

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.200 2000/10/28 19:41:00 momjian Exp $
14+
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.201 2000/10/29 16:11:33 petere Exp $
1515
*
1616
* HISTORY
1717
* AUTHOR DATE MAJOR EVENT
@@ -381,7 +381,6 @@ static void doNegateFloat(Value *v);
381381
%left '+' '-'
382382
%left '*' '/' '%'
383383
%left '^'
384-
%left '|' /* XXX Should this have such a high priority? */
385384
/* Unary Operators */
386385
%right UMINUS
387386
%left '.'
@@ -4195,7 +4194,6 @@ MathOp: '+' { $$ = "+"; }
41954194
| '/' { $$ = "/"; }
41964195
| '%' { $$ = "%"; }
41974196
| '^' { $$ = "^"; }
4198-
| '|' { $$ = "|"; }
41994197
| '<' { $$ = "<"; }
42004198
| '>' { $$ = ">"; }
42014199
| '=' { $$ = "="; }
@@ -4238,14 +4236,10 @@ a_expr: c_expr
42384236
{ $$ = makeA_Expr(OP, "%", NULL, $2); }
42394237
| '^' a_expr
42404238
{ $$ = makeA_Expr(OP, "^", NULL, $2); }
4241-
| '|' a_expr
4242-
{ $$ = makeA_Expr(OP, "|", NULL, $2); }
42434239
| a_expr '%'
42444240
{ $$ = makeA_Expr(OP, "%", $1, NULL); }
42454241
| a_expr '^'
42464242
{ $$ = makeA_Expr(OP, "^", $1, NULL); }
4247-
| a_expr '|'
4248-
{ $$ = makeA_Expr(OP, "|", $1, NULL); }
42494243
| a_expr '+' a_expr
42504244
{ $$ = makeA_Expr(OP, "+", $1, $3); }
42514245
| a_expr '-' a_expr
@@ -4258,8 +4252,6 @@ a_expr: c_expr
42584252
{ $$ = makeA_Expr(OP, "%", $1, $3); }
42594253
| a_expr '^' a_expr
42604254
{ $$ = makeA_Expr(OP, "^", $1, $3); }
4261-
| a_expr '|' a_expr
4262-
{ $$ = makeA_Expr(OP, "|", $1, $3); }
42634255
| a_expr '<' a_expr
42644256
{ $$ = makeA_Expr(OP, "<", $1, $3); }
42654257
| a_expr '>' a_expr
@@ -4492,14 +4484,10 @@ b_expr: c_expr
44924484
{ $$ = makeA_Expr(OP, "%", NULL, $2); }
44934485
| '^' b_expr
44944486
{ $$ = makeA_Expr(OP, "^", NULL, $2); }
4495-
| '|' b_expr
4496-
{ $$ = makeA_Expr(OP, "|", NULL, $2); }
44974487
| b_expr '%'
44984488
{ $$ = makeA_Expr(OP, "%", $1, NULL); }
44994489
| b_expr '^'
45004490
{ $$ = makeA_Expr(OP, "^", $1, NULL); }
4501-
| b_expr '|'
4502-
{ $$ = makeA_Expr(OP, "|", $1, NULL); }
45034491
| b_expr '+' b_expr
45044492
{ $$ = makeA_Expr(OP, "+", $1, $3); }
45054493
| b_expr '-' b_expr
@@ -4512,8 +4500,6 @@ b_expr: c_expr
45124500
{ $$ = makeA_Expr(OP, "%", $1, $3); }
45134501
| b_expr '^' b_expr
45144502
{ $$ = makeA_Expr(OP, "^", $1, $3); }
4515-
| b_expr '|' b_expr
4516-
{ $$ = makeA_Expr(OP, "|", $1, $3); }
45174503
| b_expr '<' b_expr
45184504
{ $$ = makeA_Expr(OP, "<", $1, $3); }
45194505
| b_expr '>' b_expr

src/backend/parser/scan.l

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.77 2000/09/12 21:07:02 tgl Exp $
12+
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.78 2000/10/29 16:11:33 petere Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -184,7 +184,7 @@ typecast "::"
184184
* If you change either set, adjust the character lists appearing in the
185185
* rule for "operator"!
186186
*/
187-
self [,()\[\].;$\:\+\-\*\/\%\^\<\>\=\|]
187+
self [,()\[\].;$\:\+\-\*\/\%\^\<\>\=]
188188
op_chars [\~\!\@\#\^\&\|\`\?\$\+\-\*\/\%\<\>\=]
189189
operator {op_chars}+
190190

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy