1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-25 01:02:05 +03:00

Fix portability issues in 86c43f4e22.

INT64_MIN/MAX should be spelled PG_INT64_MIN/MAX, per well established
convention in our sources.  Less obviously, a symbol named DOUBLE causes
problems on Windows builds, so rename that to DOUBLE_CONST; and rename
INTEGER to INTEGER_CONST for consistency.

Also, get rid of incorrect/obsolete hand-munging of yycolumn, and fix
the grammar for float constants to handle expected cases such as ".1".

First two items by Michael Paquier, second two by me.
This commit is contained in:
Tom Lane
2016-03-29 00:53:53 -04:00
parent 5d4171d1c7
commit 656ee84890
3 changed files with 12 additions and 9 deletions

View File

@ -47,11 +47,11 @@ static PgBenchExpr *make_func(yyscan_t yyscanner, int fnumber, PgBenchExprList *
%type <elist> elist
%type <expr> expr
%type <ival> INTEGER function
%type <dval> DOUBLE
%type <ival> INTEGER_CONST function
%type <dval> DOUBLE_CONST
%type <str> VARIABLE FUNCTION
%token INTEGER DOUBLE VARIABLE FUNCTION
%token INTEGER_CONST DOUBLE_CONST VARIABLE FUNCTION
/* Precedence: lowest to highest */
%left '+' '-'
@ -76,8 +76,8 @@ expr: '(' expr ')' { $$ = $2; }
| expr '*' expr { $$ = make_op(yyscanner, "*", $1, $3); }
| expr '/' expr { $$ = make_op(yyscanner, "/", $1, $3); }
| expr '%' expr { $$ = make_op(yyscanner, "%", $1, $3); }
| INTEGER { $$ = make_integer_constant($1); }
| DOUBLE { $$ = make_double_constant($1); }
| INTEGER_CONST { $$ = make_integer_constant($1); }
| DOUBLE_CONST { $$ = make_double_constant($1); }
| VARIABLE { $$ = make_variable($1); }
| function '(' elist ')' { $$ = make_func(yyscanner, $1, $3); }
;