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

Commit 1511534

Browse files
committed
Just noticed that the grammar actually has no provision for '+' as a
prefix operator :-(. Bad enough that we have no implementation of unary plus, but at least with this fix the grammar will take it.
1 parent caa6fc1 commit 1511534

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/backend/parser/gram.y

+8-3
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.158 2000/03/18 00:33:45 momjian Exp $
14+
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.159 2000/03/18 04:32:35 tgl Exp $
1515
*
1616
* HISTORY
1717
* AUTHOR DATE MAJOR EVENT
@@ -4168,6 +4168,8 @@ a_expr: c_expr
41684168
* If you add more explicitly-known operators, be sure to add them
41694169
* also to b_expr and to the MathOp list above.
41704170
*/
4171+
| '+' a_expr %prec UMINUS
4172+
{ $$ = makeA_Expr(OP, "+", NULL, $2); }
41714173
| '-' a_expr %prec UMINUS
41724174
{ $$ = doNegate($2); }
41734175
| '%' a_expr
@@ -4384,6 +4386,8 @@ b_expr: c_expr
43844386
{ $$ = $1; }
43854387
| b_expr TYPECAST Typename
43864388
{ $$ = makeTypeCast($1, $3); }
4389+
| '+' b_expr %prec UMINUS
4390+
{ $$ = makeA_Expr(OP, "+", NULL, $2); }
43874391
| '-' b_expr %prec UMINUS
43884392
{ $$ = doNegate($2); }
43894393
| '%' b_expr
@@ -5480,8 +5484,9 @@ mapTargetColumns(List *src, List *dst)
54805484
* Do not convert "float", since that is handled elsewhere
54815485
* for FLOAT(p) syntax.
54825486
*
5483-
* Converting "datetime" to "timestamp" is a temporary expedient for
5484-
* pre-7.0 to 7.0 compatibility; it should go away again someday.
5487+
* Converting "datetime" to "timestamp" and "timespan" to "interval"
5488+
* is a temporary expedient for pre-7.0 to 7.0 compatibility;
5489+
* these should go away someday.
54855490
*/
54865491
static char *
54875492
xlateSqlFunc(char *name)

0 commit comments

Comments
 (0)