1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-17 06:41:09 +03:00

Revert FETCH/MOVE int64 patch. Was using incorrect checks for

fetch/move in scan.l.
This commit is contained in:
Bruce Momjian
2006-09-03 03:19:45 +00:00
parent d387a07050
commit 0e20c48561
10 changed files with 51 additions and 115 deletions

View File

@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.563 2006/09/03 00:46:41 momjian Exp $
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.564 2006/09/03 03:19:44 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@ -116,7 +116,6 @@ static void doNegateFloat(Value *v);
%union
{
int ival;
int64 i64val;
char chr;
char *str;
const char *keyword;
@ -325,7 +324,6 @@ static void doNegateFloat(Value *v);
%type <boolean> opt_varying opt_timezone
%type <ival> Iconst SignedIconst
%type <i64val> SignedI64const
%type <str> Sconst comment_text
%type <str> RoleId opt_granted_by opt_boolean ColId_or_Sconst
%type <list> var_list var_list_or_default
@ -450,7 +448,6 @@ static void doNegateFloat(Value *v);
/* Special token types, not actually keywords - see the "lex" file */
%token <str> IDENT FCONST SCONST BCONST XCONST Op
%token <ival> ICONST PARAM
%token <i64val> I64CONST
/* precedence: lowest to highest */
%nonassoc SET /* see relation_expr_opt_alias */
@ -3359,27 +3356,6 @@ fetch_direction:
n->howMany = $1;
$$ = (Node *)n;
}
| ABSOLUTE_P SignedI64const
{
FetchStmt *n = makeNode(FetchStmt);
n->direction = FETCH_ABSOLUTE;
n->howMany = $2;
$$ = (Node *)n;
}
| RELATIVE_P SignedI64const
{
FetchStmt *n = makeNode(FetchStmt);
n->direction = FETCH_RELATIVE;
n->howMany = $2;
$$ = (Node *)n;
}
| SignedI64const
{
FetchStmt *n = makeNode(FetchStmt);
n->direction = FETCH_FORWARD;
n->howMany = $1;
$$ = (Node *)n;
}
| ALL
{
FetchStmt *n = makeNode(FetchStmt);
@ -3401,13 +3377,6 @@ fetch_direction:
n->howMany = $2;
$$ = (Node *)n;
}
| FORWARD SignedI64const
{
FetchStmt *n = makeNode(FetchStmt);
n->direction = FETCH_FORWARD;
n->howMany = $2;
$$ = (Node *)n;
}
| FORWARD ALL
{
FetchStmt *n = makeNode(FetchStmt);
@ -3429,13 +3398,6 @@ fetch_direction:
n->howMany = $2;
$$ = (Node *)n;
}
| BACKWARD SignedI64const
{
FetchStmt *n = makeNode(FetchStmt);
n->direction = FETCH_BACKWARD;
n->howMany = $2;
$$ = (Node *)n;
}
| BACKWARD ALL
{
FetchStmt *n = makeNode(FetchStmt);
@ -8540,9 +8502,6 @@ RoleId: ColId { $$ = $1; };
SignedIconst: ICONST { $$ = $1; }
| '-' ICONST { $$ = - $2; }
;
SignedI64const: I64CONST { $$ = $1; }
| '-' I64CONST { $$ = - $2; }
;
/*
* Name classification hierarchy.

View File

@ -24,7 +24,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/scan.l,v 1.136 2006/09/02 18:17:17 momjian Exp $
* $PostgreSQL: pgsql/src/backend/parser/scan.l,v 1.137 2006/09/03 03:19:44 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -666,22 +666,6 @@ other .
#endif
)
{
/* For Fetch/Move stmt, convert the string into int64 value */
if((strcmp(yylval.keyword, "fetch")==0) || (strcmp(yylval.keyword, "move")==0))
{
int64 int64Val;
errno = 0;
int64Val = strtoll(yytext, &endptr, 10);
if (*endptr != '\0' || errno == ERANGE)
{
yylval.str = pstrdup(yytext);
return FCONST;
}
yylval.i64val = int64Val;
return I64CONST;
}
/* integer too large, treat it as a float */
yylval.str = pstrdup(yytext);
return FCONST;