mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
Allow TIMESTAMP, VARCHAR, et al to be used as unquoted column names,
though alas not as unquoted function names. De-reserve a bunch of keywords that could have been in ColId rather than ColLabel all along. Per recent proposal in pgsql-patches.
This commit is contained in:
@ -11,7 +11,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.272 2001/11/05 05:00:14 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.273 2001/11/10 22:31:49 tgl Exp $
|
||||||
*
|
*
|
||||||
* HISTORY
|
* HISTORY
|
||||||
* AUTHOR DATE MAJOR EVENT
|
* AUTHOR DATE MAJOR EVENT
|
||||||
@ -257,8 +257,8 @@ static void doNegateFloat(Value *v);
|
|||||||
%type <paramno> ParamNo
|
%type <paramno> ParamNo
|
||||||
|
|
||||||
%type <typnam> Typename, SimpleTypename, ConstTypename
|
%type <typnam> Typename, SimpleTypename, ConstTypename
|
||||||
GenericType, Numeric, Geometric, Character, ConstDatetime, ConstInterval, Bit
|
GenericType, Numeric, Character, ConstDatetime, ConstInterval, Bit
|
||||||
%type <str> character, datetime, bit
|
%type <str> character, bit
|
||||||
%type <str> extract_arg
|
%type <str> extract_arg
|
||||||
%type <str> opt_charset, opt_collate
|
%type <str> opt_charset, opt_collate
|
||||||
%type <str> opt_float
|
%type <str> opt_float
|
||||||
@ -268,7 +268,7 @@ static void doNegateFloat(Value *v);
|
|||||||
%type <ival> Iconst
|
%type <ival> Iconst
|
||||||
%type <str> Sconst, comment_text
|
%type <str> Sconst, comment_text
|
||||||
%type <str> UserId, opt_boolean, var_value, ColId_or_Sconst
|
%type <str> UserId, opt_boolean, var_value, ColId_or_Sconst
|
||||||
%type <str> ColId, ColLabel, TokenId
|
%type <str> ColId, TypeFuncId, ColLabel
|
||||||
%type <node> zone_value
|
%type <node> zone_value
|
||||||
|
|
||||||
%type <node> TableConstraint
|
%type <node> TableConstraint
|
||||||
@ -1007,11 +1007,11 @@ constraints_set_list: ALL
|
|||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
constraints_set_namelist: IDENT
|
constraints_set_namelist: ColId
|
||||||
{
|
{
|
||||||
$$ = makeList1($1);
|
$$ = makeList1($1);
|
||||||
}
|
}
|
||||||
| constraints_set_namelist ',' IDENT
|
| constraints_set_namelist ',' ColId
|
||||||
{
|
{
|
||||||
$$ = lappend($1, $3);
|
$$ = lappend($1, $3);
|
||||||
}
|
}
|
||||||
@ -2007,8 +2007,8 @@ def_elem: ColLabel '=' def_arg
|
|||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
/* Note: any simple identifier will be returned as a type name! */
|
||||||
def_arg: func_return { $$ = (Node *)$1; }
|
def_arg: func_return { $$ = (Node *)$1; }
|
||||||
| TokenId { $$ = (Node *)makeString($1); }
|
|
||||||
| all_Op { $$ = (Node *)makeString($1); }
|
| all_Op { $$ = (Node *)makeString($1); }
|
||||||
| NumericOnly { $$ = (Node *)$1; }
|
| NumericOnly { $$ = (Node *)$1; }
|
||||||
| Sconst { $$ = (Node *)makeString($1); }
|
| Sconst { $$ = (Node *)makeString($1); }
|
||||||
@ -2629,11 +2629,15 @@ func_return: func_type
|
|||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We would like to make the second production here be ColId '.' ColId etc,
|
||||||
|
* but that causes reduce/reduce conflicts. TypeFuncId is next best choice.
|
||||||
|
*/
|
||||||
func_type: Typename
|
func_type: Typename
|
||||||
{
|
{
|
||||||
$$ = $1;
|
$$ = $1;
|
||||||
}
|
}
|
||||||
| IDENT '.' ColId '%' TYPE_P
|
| TypeFuncId '.' ColId '%' TYPE_P
|
||||||
{
|
{
|
||||||
$$ = makeNode(TypeName);
|
$$ = makeNode(TypeName);
|
||||||
$$->name = $1;
|
$$->name = $1;
|
||||||
@ -4064,13 +4068,12 @@ SimpleTypename: ConstTypename
|
|||||||
|
|
||||||
ConstTypename: GenericType
|
ConstTypename: GenericType
|
||||||
| Numeric
|
| Numeric
|
||||||
| Geometric
|
|
||||||
| Bit
|
| Bit
|
||||||
| Character
|
| Character
|
||||||
| ConstDatetime
|
| ConstDatetime
|
||||||
;
|
;
|
||||||
|
|
||||||
GenericType: IDENT
|
GenericType: TypeFuncId
|
||||||
{
|
{
|
||||||
$$ = makeNode(TypeName);
|
$$ = makeNode(TypeName);
|
||||||
$$->name = xlateSqlType($1);
|
$$->name = xlateSqlType($1);
|
||||||
@ -4086,7 +4089,7 @@ GenericType: IDENT
|
|||||||
Numeric: FLOAT opt_float
|
Numeric: FLOAT opt_float
|
||||||
{
|
{
|
||||||
$$ = makeNode(TypeName);
|
$$ = makeNode(TypeName);
|
||||||
$$->name = xlateSqlType($2);
|
$$->name = $2; /* already xlated */
|
||||||
$$->typmod = -1;
|
$$->typmod = -1;
|
||||||
}
|
}
|
||||||
| DOUBLE PRECISION
|
| DOUBLE PRECISION
|
||||||
@ -4115,14 +4118,6 @@ Numeric: FLOAT opt_float
|
|||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
Geometric: PATH_P
|
|
||||||
{
|
|
||||||
$$ = makeNode(TypeName);
|
|
||||||
$$->name = xlateSqlType("path");
|
|
||||||
$$->typmod = -1;
|
|
||||||
}
|
|
||||||
;
|
|
||||||
|
|
||||||
opt_float: '(' Iconst ')'
|
opt_float: '(' Iconst ')'
|
||||||
{
|
{
|
||||||
if ($2 < 1)
|
if ($2 < 1)
|
||||||
@ -4299,13 +4294,7 @@ opt_collate: COLLATE ColId { $$ = $2; }
|
|||||||
| /*EMPTY*/ { $$ = NULL; }
|
| /*EMPTY*/ { $$ = NULL; }
|
||||||
;
|
;
|
||||||
|
|
||||||
ConstDatetime: datetime
|
ConstDatetime: TIMESTAMP '(' Iconst ')' opt_timezone_x
|
||||||
{
|
|
||||||
$$ = makeNode(TypeName);
|
|
||||||
$$->name = xlateSqlType($1);
|
|
||||||
$$->typmod = -1;
|
|
||||||
}
|
|
||||||
| TIMESTAMP '(' Iconst ')' opt_timezone_x
|
|
||||||
{
|
{
|
||||||
$$ = makeNode(TypeName);
|
$$ = makeNode(TypeName);
|
||||||
if ($5)
|
if ($5)
|
||||||
@ -4371,14 +4360,6 @@ ConstInterval: INTERVAL
|
|||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
datetime: YEAR_P { $$ = "year"; }
|
|
||||||
| MONTH_P { $$ = "month"; }
|
|
||||||
| DAY_P { $$ = "day"; }
|
|
||||||
| HOUR_P { $$ = "hour"; }
|
|
||||||
| MINUTE_P { $$ = "minute"; }
|
|
||||||
| SECOND_P { $$ = "second"; }
|
|
||||||
;
|
|
||||||
|
|
||||||
/* XXX Make the default be WITH TIME ZONE for 7.2 to help with database upgrades
|
/* XXX Make the default be WITH TIME ZONE for 7.2 to help with database upgrades
|
||||||
* but revert this back to WITHOUT TIME ZONE for 7.3.
|
* but revert this back to WITHOUT TIME ZONE for 7.3.
|
||||||
* Do this by simply reverting opt_timezone_x to opt_timezone - thomas 2001-09-06
|
* Do this by simply reverting opt_timezone_x to opt_timezone - thomas 2001-09-06
|
||||||
@ -5270,9 +5251,14 @@ extract_list: extract_arg FROM a_expr
|
|||||||
* - thomas 2001-04-12
|
* - thomas 2001-04-12
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extract_arg: datetime { $$ = $1; }
|
extract_arg: IDENT { $$ = $1; }
|
||||||
| SCONST { $$ = $1; }
|
| YEAR_P { $$ = "year"; }
|
||||||
| IDENT { $$ = $1; }
|
| MONTH_P { $$ = "month"; }
|
||||||
|
| DAY_P { $$ = "day"; }
|
||||||
|
| HOUR_P { $$ = "hour"; }
|
||||||
|
| MINUTE_P { $$ = "minute"; }
|
||||||
|
| SECOND_P { $$ = "second"; }
|
||||||
|
| SCONST { $$ = $1; }
|
||||||
;
|
;
|
||||||
|
|
||||||
/* position_list uses b_expr not a_expr to avoid conflict with general IN */
|
/* position_list uses b_expr not a_expr to avoid conflict with general IN */
|
||||||
@ -5555,32 +5541,6 @@ access_method: ColId { $$ = $1; };
|
|||||||
attr_name: ColId { $$ = $1; };
|
attr_name: ColId { $$ = $1; };
|
||||||
class: ColId { $$ = $1; };
|
class: ColId { $$ = $1; };
|
||||||
index_name: ColId { $$ = $1; };
|
index_name: ColId { $$ = $1; };
|
||||||
|
|
||||||
/* Functions
|
|
||||||
* Include date/time keywords as SQL92 extension.
|
|
||||||
* Include TYPE as a SQL92 unreserved keyword. - thomas 1997-10-05
|
|
||||||
* Any tokens which show up as operators will screw up the parsing if
|
|
||||||
* allowed as identifiers, but are acceptable as ColLabels:
|
|
||||||
* BETWEEN, IN, IS, ISNULL, NOTNULL, OVERLAPS
|
|
||||||
* Thanks to Tom Lane for pointing this out. - thomas 2000-03-29
|
|
||||||
* We need OVERLAPS allowed as a function name to enable the implementation
|
|
||||||
* of argument type variations on the underlying implementation. These
|
|
||||||
* variations are done as SQL-language entries in the pg_proc catalog.
|
|
||||||
* Do not include SUBSTRING here since it has explicit productions
|
|
||||||
* in a_expr to support the goofy SQL9x argument syntax.
|
|
||||||
* - thomas 2000-11-28
|
|
||||||
*/
|
|
||||||
func_name: ColId { $$ = xlateSqlFunc($1); }
|
|
||||||
| BETWEEN { $$ = xlateSqlFunc("between"); }
|
|
||||||
| ILIKE { $$ = xlateSqlFunc("ilike"); }
|
|
||||||
| IN { $$ = xlateSqlFunc("in"); }
|
|
||||||
| IS { $$ = xlateSqlFunc("is"); }
|
|
||||||
| ISNULL { $$ = xlateSqlFunc("isnull"); }
|
|
||||||
| LIKE { $$ = xlateSqlFunc("like"); }
|
|
||||||
| NOTNULL { $$ = xlateSqlFunc("notnull"); }
|
|
||||||
| OVERLAPS { $$ = xlateSqlFunc("overlaps"); }
|
|
||||||
;
|
|
||||||
|
|
||||||
file_name: Sconst { $$ = $1; };
|
file_name: Sconst { $$ = $1; };
|
||||||
|
|
||||||
/* Constants
|
/* Constants
|
||||||
@ -5692,27 +5652,23 @@ Iconst: ICONST { $$ = $1; };
|
|||||||
Sconst: SCONST { $$ = $1; };
|
Sconst: SCONST { $$ = $1; };
|
||||||
UserId: ColId { $$ = $1; };
|
UserId: ColId { $$ = $1; };
|
||||||
|
|
||||||
/* Column identifier
|
/*
|
||||||
* Include date/time keywords as SQL92 extension.
|
* Keyword classification lists. Generally, every keyword present in
|
||||||
* Include TYPE as a SQL92 unreserved keyword. - thomas 1997-10-05
|
* the Postgres grammar should be in one of these lists. (Presently,
|
||||||
* Add other keywords. Note that as the syntax expands,
|
* "AS" is the sole exception: it is our only completely-reserved word.)
|
||||||
* some of these keywords will have to be removed from this
|
*
|
||||||
* list due to shift/reduce conflicts in yacc. If so, move
|
* Put a new keyword into the earliest list (of TypeFuncId, ColId, ColLabel)
|
||||||
* down to the ColLabel entity. - thomas 1997-11-06
|
* that it can go into without creating shift or reduce conflicts. The
|
||||||
|
* earlier lists define "less reserved" categories of keywords. Notice that
|
||||||
|
* each list includes by reference the ones before it.
|
||||||
*/
|
*/
|
||||||
ColId: IDENT { $$ = $1; }
|
|
||||||
| datetime { $$ = $1; }
|
|
||||||
| TokenId { $$ = $1; }
|
|
||||||
| NATIONAL { $$ = "national"; }
|
|
||||||
| NONE { $$ = "none"; }
|
|
||||||
| PATH_P { $$ = "path"; }
|
|
||||||
;
|
|
||||||
|
|
||||||
/* Parser tokens to be used as identifiers.
|
/* Type/func identifier --- names that can be type and function names
|
||||||
* Tokens involving data types should appear in ColId only,
|
* (as well as ColIds --- ie, these are completely unreserved keywords).
|
||||||
* since they will conflict with real TypeName productions.
|
|
||||||
*/
|
*/
|
||||||
TokenId: ABSOLUTE { $$ = "absolute"; }
|
TypeFuncId: IDENT { $$ = $1; }
|
||||||
|
| ABORT_TRANS { $$ = "abort"; }
|
||||||
|
| ABSOLUTE { $$ = "absolute"; }
|
||||||
| ACCESS { $$ = "access"; }
|
| ACCESS { $$ = "access"; }
|
||||||
| ACTION { $$ = "action"; }
|
| ACTION { $$ = "action"; }
|
||||||
| ADD { $$ = "add"; }
|
| ADD { $$ = "add"; }
|
||||||
@ -5731,16 +5687,19 @@ TokenId: ABSOLUTE { $$ = "absolute"; }
|
|||||||
| CHARACTERISTICS { $$ = "characteristics"; }
|
| CHARACTERISTICS { $$ = "characteristics"; }
|
||||||
| CHECKPOINT { $$ = "checkpoint"; }
|
| CHECKPOINT { $$ = "checkpoint"; }
|
||||||
| CLOSE { $$ = "close"; }
|
| CLOSE { $$ = "close"; }
|
||||||
|
| CLUSTER { $$ = "cluster"; }
|
||||||
| COMMENT { $$ = "comment"; }
|
| COMMENT { $$ = "comment"; }
|
||||||
| COMMIT { $$ = "commit"; }
|
| COMMIT { $$ = "commit"; }
|
||||||
| COMMITTED { $$ = "committed"; }
|
| COMMITTED { $$ = "committed"; }
|
||||||
| CONSTRAINTS { $$ = "constraints"; }
|
| CONSTRAINTS { $$ = "constraints"; }
|
||||||
|
| COPY { $$ = "copy"; }
|
||||||
| CREATE { $$ = "create"; }
|
| CREATE { $$ = "create"; }
|
||||||
| CREATEDB { $$ = "createdb"; }
|
| CREATEDB { $$ = "createdb"; }
|
||||||
| CREATEUSER { $$ = "createuser"; }
|
| CREATEUSER { $$ = "createuser"; }
|
||||||
| CURSOR { $$ = "cursor"; }
|
| CURSOR { $$ = "cursor"; }
|
||||||
| CYCLE { $$ = "cycle"; }
|
| CYCLE { $$ = "cycle"; }
|
||||||
| DATABASE { $$ = "database"; }
|
| DATABASE { $$ = "database"; }
|
||||||
|
| DAY_P { $$ = "day"; }
|
||||||
| DECLARE { $$ = "declare"; }
|
| DECLARE { $$ = "declare"; }
|
||||||
| DEFERRED { $$ = "deferred"; }
|
| DEFERRED { $$ = "deferred"; }
|
||||||
| DELETE { $$ = "delete"; }
|
| DELETE { $$ = "delete"; }
|
||||||
@ -5753,16 +5712,20 @@ TokenId: ABSOLUTE { $$ = "absolute"; }
|
|||||||
| ESCAPE { $$ = "escape"; }
|
| ESCAPE { $$ = "escape"; }
|
||||||
| EXCLUSIVE { $$ = "exclusive"; }
|
| EXCLUSIVE { $$ = "exclusive"; }
|
||||||
| EXECUTE { $$ = "execute"; }
|
| EXECUTE { $$ = "execute"; }
|
||||||
|
| EXPLAIN { $$ = "explain"; }
|
||||||
| FETCH { $$ = "fetch"; }
|
| FETCH { $$ = "fetch"; }
|
||||||
| FORCE { $$ = "force"; }
|
| FORCE { $$ = "force"; }
|
||||||
| FORWARD { $$ = "forward"; }
|
| FORWARD { $$ = "forward"; }
|
||||||
| FUNCTION { $$ = "function"; }
|
| FUNCTION { $$ = "function"; }
|
||||||
|
| GLOBAL { $$ = "global"; }
|
||||||
| GRANT { $$ = "grant"; }
|
| GRANT { $$ = "grant"; }
|
||||||
| HANDLER { $$ = "handler"; }
|
| HANDLER { $$ = "handler"; }
|
||||||
|
| HOUR_P { $$ = "hour"; }
|
||||||
| IMMEDIATE { $$ = "immediate"; }
|
| IMMEDIATE { $$ = "immediate"; }
|
||||||
| INCREMENT { $$ = "increment"; }
|
| INCREMENT { $$ = "increment"; }
|
||||||
| INDEX { $$ = "index"; }
|
| INDEX { $$ = "index"; }
|
||||||
| INHERITS { $$ = "inherits"; }
|
| INHERITS { $$ = "inherits"; }
|
||||||
|
| INOUT { $$ = "inout"; }
|
||||||
| INSENSITIVE { $$ = "insensitive"; }
|
| INSENSITIVE { $$ = "insensitive"; }
|
||||||
| INSERT { $$ = "insert"; }
|
| INSERT { $$ = "insert"; }
|
||||||
| INSTEAD { $$ = "instead"; }
|
| INSTEAD { $$ = "instead"; }
|
||||||
@ -5771,12 +5734,20 @@ TokenId: ABSOLUTE { $$ = "absolute"; }
|
|||||||
| LANGUAGE { $$ = "language"; }
|
| LANGUAGE { $$ = "language"; }
|
||||||
| LANCOMPILER { $$ = "lancompiler"; }
|
| LANCOMPILER { $$ = "lancompiler"; }
|
||||||
| LEVEL { $$ = "level"; }
|
| LEVEL { $$ = "level"; }
|
||||||
|
| LISTEN { $$ = "listen"; }
|
||||||
|
| LOAD { $$ = "load"; }
|
||||||
|
| LOCAL { $$ = "local"; }
|
||||||
| LOCATION { $$ = "location"; }
|
| LOCATION { $$ = "location"; }
|
||||||
|
| LOCK_P { $$ = "lock"; }
|
||||||
| MATCH { $$ = "match"; }
|
| MATCH { $$ = "match"; }
|
||||||
| MAXVALUE { $$ = "maxvalue"; }
|
| MAXVALUE { $$ = "maxvalue"; }
|
||||||
|
| MINUTE_P { $$ = "minute"; }
|
||||||
| MINVALUE { $$ = "minvalue"; }
|
| MINVALUE { $$ = "minvalue"; }
|
||||||
| MODE { $$ = "mode"; }
|
| MODE { $$ = "mode"; }
|
||||||
|
| MONTH_P { $$ = "month"; }
|
||||||
|
| MOVE { $$ = "move"; }
|
||||||
| NAMES { $$ = "names"; }
|
| NAMES { $$ = "names"; }
|
||||||
|
| NATIONAL { $$ = "national"; }
|
||||||
| NEXT { $$ = "next"; }
|
| NEXT { $$ = "next"; }
|
||||||
| NO { $$ = "no"; }
|
| NO { $$ = "no"; }
|
||||||
| NOCREATEDB { $$ = "nocreatedb"; }
|
| NOCREATEDB { $$ = "nocreatedb"; }
|
||||||
@ -5787,10 +5758,13 @@ TokenId: ABSOLUTE { $$ = "absolute"; }
|
|||||||
| OIDS { $$ = "oids"; }
|
| OIDS { $$ = "oids"; }
|
||||||
| OPERATOR { $$ = "operator"; }
|
| OPERATOR { $$ = "operator"; }
|
||||||
| OPTION { $$ = "option"; }
|
| OPTION { $$ = "option"; }
|
||||||
|
| OUT { $$ = "out"; }
|
||||||
| OWNER { $$ = "owner"; }
|
| OWNER { $$ = "owner"; }
|
||||||
| PARTIAL { $$ = "partial"; }
|
| PARTIAL { $$ = "partial"; }
|
||||||
| PASSWORD { $$ = "password"; }
|
| PASSWORD { $$ = "password"; }
|
||||||
|
| PATH_P { $$ = "path"; }
|
||||||
| PENDANT { $$ = "pendant"; }
|
| PENDANT { $$ = "pendant"; }
|
||||||
|
| PRECISION { $$ = "precision"; }
|
||||||
| PRIOR { $$ = "prior"; }
|
| PRIOR { $$ = "prior"; }
|
||||||
| PRIVILEGES { $$ = "privileges"; }
|
| PRIVILEGES { $$ = "privileges"; }
|
||||||
| PROCEDURAL { $$ = "procedural"; }
|
| PROCEDURAL { $$ = "procedural"; }
|
||||||
@ -5800,6 +5774,7 @@ TokenId: ABSOLUTE { $$ = "absolute"; }
|
|||||||
| RELATIVE { $$ = "relative"; }
|
| RELATIVE { $$ = "relative"; }
|
||||||
| RENAME { $$ = "rename"; }
|
| RENAME { $$ = "rename"; }
|
||||||
| REPLACE { $$ = "replace"; }
|
| REPLACE { $$ = "replace"; }
|
||||||
|
| RESET { $$ = "reset"; }
|
||||||
| RESTRICT { $$ = "restrict"; }
|
| RESTRICT { $$ = "restrict"; }
|
||||||
| RETURNS { $$ = "returns"; }
|
| RETURNS { $$ = "returns"; }
|
||||||
| REVOKE { $$ = "revoke"; }
|
| REVOKE { $$ = "revoke"; }
|
||||||
@ -5808,11 +5783,13 @@ TokenId: ABSOLUTE { $$ = "absolute"; }
|
|||||||
| RULE { $$ = "rule"; }
|
| RULE { $$ = "rule"; }
|
||||||
| SCHEMA { $$ = "schema"; }
|
| SCHEMA { $$ = "schema"; }
|
||||||
| SCROLL { $$ = "scroll"; }
|
| SCROLL { $$ = "scroll"; }
|
||||||
|
| SECOND_P { $$ = "second"; }
|
||||||
| SESSION { $$ = "session"; }
|
| SESSION { $$ = "session"; }
|
||||||
| SEQUENCE { $$ = "sequence"; }
|
| SEQUENCE { $$ = "sequence"; }
|
||||||
| SERIALIZABLE { $$ = "serializable"; }
|
| SERIALIZABLE { $$ = "serializable"; }
|
||||||
| SET { $$ = "set"; }
|
| SET { $$ = "set"; }
|
||||||
| SHARE { $$ = "share"; }
|
| SHARE { $$ = "share"; }
|
||||||
|
| SHOW { $$ = "show"; }
|
||||||
| START { $$ = "start"; }
|
| START { $$ = "start"; }
|
||||||
| STATEMENT { $$ = "statement"; }
|
| STATEMENT { $$ = "statement"; }
|
||||||
| STATISTICS { $$ = "statistics"; }
|
| STATISTICS { $$ = "statistics"; }
|
||||||
@ -5823,14 +5800,17 @@ TokenId: ABSOLUTE { $$ = "absolute"; }
|
|||||||
| TEMPLATE { $$ = "template"; }
|
| TEMPLATE { $$ = "template"; }
|
||||||
| TEMPORARY { $$ = "temporary"; }
|
| TEMPORARY { $$ = "temporary"; }
|
||||||
| TOAST { $$ = "toast"; }
|
| TOAST { $$ = "toast"; }
|
||||||
|
| TRANSACTION { $$ = "transaction"; }
|
||||||
| TRIGGER { $$ = "trigger"; }
|
| TRIGGER { $$ = "trigger"; }
|
||||||
| TRUNCATE { $$ = "truncate"; }
|
| TRUNCATE { $$ = "truncate"; }
|
||||||
| TRUSTED { $$ = "trusted"; }
|
| TRUSTED { $$ = "trusted"; }
|
||||||
| TYPE_P { $$ = "type"; }
|
| TYPE_P { $$ = "type"; }
|
||||||
| UNENCRYPTED { $$ = "unencrypted"; }
|
| UNENCRYPTED { $$ = "unencrypted"; }
|
||||||
|
| UNKNOWN { $$ = "unknown"; }
|
||||||
| UNLISTEN { $$ = "unlisten"; }
|
| UNLISTEN { $$ = "unlisten"; }
|
||||||
| UNTIL { $$ = "until"; }
|
| UNTIL { $$ = "until"; }
|
||||||
| UPDATE { $$ = "update"; }
|
| UPDATE { $$ = "update"; }
|
||||||
|
| VACUUM { $$ = "vacuum"; }
|
||||||
| VALID { $$ = "valid"; }
|
| VALID { $$ = "valid"; }
|
||||||
| VALUES { $$ = "values"; }
|
| VALUES { $$ = "values"; }
|
||||||
| VARYING { $$ = "varying"; }
|
| VARYING { $$ = "varying"; }
|
||||||
@ -5839,21 +5819,45 @@ TokenId: ABSOLUTE { $$ = "absolute"; }
|
|||||||
| WITH { $$ = "with"; }
|
| WITH { $$ = "with"; }
|
||||||
| WITHOUT { $$ = "without"; }
|
| WITHOUT { $$ = "without"; }
|
||||||
| WORK { $$ = "work"; }
|
| WORK { $$ = "work"; }
|
||||||
|
| YEAR_P { $$ = "year"; }
|
||||||
| ZONE { $$ = "zone"; }
|
| ZONE { $$ = "zone"; }
|
||||||
;
|
;
|
||||||
|
|
||||||
/* Column label
|
/* Column identifier --- names that can be column, table, etc names.
|
||||||
* Allowed labels in "AS" clauses.
|
*
|
||||||
* Include TRUE/FALSE SQL3 reserved words for Postgres backward
|
* This contains the TypeFuncId list plus those keywords that conflict
|
||||||
* compatibility. Cannot allow this for column names since the
|
* only with typename productions, not with other uses. Note that
|
||||||
* syntax would not distinguish between the constant value and
|
* most of these keywords will in fact be recognized as type names too;
|
||||||
* a column name. - thomas 1997-10-24
|
* they just have to have special productions for the purpose.
|
||||||
* Add other keywords to this list. Note that they appear here
|
*
|
||||||
* rather than in ColId if there was a shift/reduce conflict
|
* Most of these cannot be in TypeFuncId (ie, are not also usable as function
|
||||||
* when used as a full identifier. - thomas 1997-11-06
|
* names) because they can be followed by '(' in typename productions, which
|
||||||
|
* looks too much like a function call for a LALR(1) parser.
|
||||||
|
*/
|
||||||
|
ColId: TypeFuncId { $$ = $1; }
|
||||||
|
| BIT { $$ = "bit"; }
|
||||||
|
| CHAR { $$ = "char"; }
|
||||||
|
| CHARACTER { $$ = "character"; }
|
||||||
|
| DEC { $$ = "dec"; }
|
||||||
|
| DECIMAL { $$ = "decimal"; }
|
||||||
|
| FLOAT { $$ = "float"; }
|
||||||
|
| INTERVAL { $$ = "interval"; }
|
||||||
|
| NCHAR { $$ = "nchar"; }
|
||||||
|
| NONE { $$ = "none"; }
|
||||||
|
| NUMERIC { $$ = "numeric"; }
|
||||||
|
| SETOF { $$ = "setof"; }
|
||||||
|
| TIME { $$ = "time"; }
|
||||||
|
| TIMESTAMP { $$ = "timestamp"; }
|
||||||
|
| VARCHAR { $$ = "varchar"; }
|
||||||
|
;
|
||||||
|
|
||||||
|
/* Column label --- allowed labels in "AS" clauses.
|
||||||
|
*
|
||||||
|
* Keywords appear here if they could not be distinguished from variable,
|
||||||
|
* type, or function names in some contexts.
|
||||||
|
* When adding a ColLabel, consider whether it can be added to func_name.
|
||||||
*/
|
*/
|
||||||
ColLabel: ColId { $$ = $1; }
|
ColLabel: ColId { $$ = $1; }
|
||||||
| ABORT_TRANS { $$ = "abort"; }
|
|
||||||
| ALL { $$ = "all"; }
|
| ALL { $$ = "all"; }
|
||||||
| ANALYSE { $$ = "analyse"; } /* British */
|
| ANALYSE { $$ = "analyse"; } /* British */
|
||||||
| ANALYZE { $$ = "analyze"; }
|
| ANALYZE { $$ = "analyze"; }
|
||||||
@ -5862,26 +5866,19 @@ ColLabel: ColId { $$ = $1; }
|
|||||||
| ASC { $$ = "asc"; }
|
| ASC { $$ = "asc"; }
|
||||||
| BETWEEN { $$ = "between"; }
|
| BETWEEN { $$ = "between"; }
|
||||||
| BINARY { $$ = "binary"; }
|
| BINARY { $$ = "binary"; }
|
||||||
| BIT { $$ = "bit"; }
|
|
||||||
| BOTH { $$ = "both"; }
|
| BOTH { $$ = "both"; }
|
||||||
| CASE { $$ = "case"; }
|
| CASE { $$ = "case"; }
|
||||||
| CAST { $$ = "cast"; }
|
| CAST { $$ = "cast"; }
|
||||||
| CHAR { $$ = "char"; }
|
|
||||||
| CHARACTER { $$ = "character"; }
|
|
||||||
| CHECK { $$ = "check"; }
|
| CHECK { $$ = "check"; }
|
||||||
| CLUSTER { $$ = "cluster"; }
|
|
||||||
| COALESCE { $$ = "coalesce"; }
|
| COALESCE { $$ = "coalesce"; }
|
||||||
| COLLATE { $$ = "collate"; }
|
| COLLATE { $$ = "collate"; }
|
||||||
| COLUMN { $$ = "column"; }
|
| COLUMN { $$ = "column"; }
|
||||||
| CONSTRAINT { $$ = "constraint"; }
|
| CONSTRAINT { $$ = "constraint"; }
|
||||||
| COPY { $$ = "copy"; }
|
|
||||||
| CROSS { $$ = "cross"; }
|
| CROSS { $$ = "cross"; }
|
||||||
| CURRENT_DATE { $$ = "current_date"; }
|
| CURRENT_DATE { $$ = "current_date"; }
|
||||||
| CURRENT_TIME { $$ = "current_time"; }
|
| CURRENT_TIME { $$ = "current_time"; }
|
||||||
| CURRENT_TIMESTAMP { $$ = "current_timestamp"; }
|
| CURRENT_TIMESTAMP { $$ = "current_timestamp"; }
|
||||||
| CURRENT_USER { $$ = "current_user"; }
|
| CURRENT_USER { $$ = "current_user"; }
|
||||||
| DEC { $$ = "dec"; }
|
|
||||||
| DECIMAL { $$ = "decimal"; }
|
|
||||||
| DEFAULT { $$ = "default"; }
|
| DEFAULT { $$ = "default"; }
|
||||||
| DEFERRABLE { $$ = "deferrable"; }
|
| DEFERRABLE { $$ = "deferrable"; }
|
||||||
| DESC { $$ = "desc"; }
|
| DESC { $$ = "desc"; }
|
||||||
@ -5891,25 +5888,20 @@ ColLabel: ColId { $$ = $1; }
|
|||||||
| END_TRANS { $$ = "end"; }
|
| END_TRANS { $$ = "end"; }
|
||||||
| EXCEPT { $$ = "except"; }
|
| EXCEPT { $$ = "except"; }
|
||||||
| EXISTS { $$ = "exists"; }
|
| EXISTS { $$ = "exists"; }
|
||||||
| EXPLAIN { $$ = "explain"; }
|
|
||||||
| EXTRACT { $$ = "extract"; }
|
| EXTRACT { $$ = "extract"; }
|
||||||
| FALSE_P { $$ = "false"; }
|
| FALSE_P { $$ = "false"; }
|
||||||
| FLOAT { $$ = "float"; }
|
|
||||||
| FOR { $$ = "for"; }
|
| FOR { $$ = "for"; }
|
||||||
| FOREIGN { $$ = "foreign"; }
|
| FOREIGN { $$ = "foreign"; }
|
||||||
| FREEZE { $$ = "freeze"; }
|
| FREEZE { $$ = "freeze"; }
|
||||||
| FROM { $$ = "from"; }
|
| FROM { $$ = "from"; }
|
||||||
| FULL { $$ = "full"; }
|
| FULL { $$ = "full"; }
|
||||||
| GLOBAL { $$ = "global"; }
|
|
||||||
| GROUP { $$ = "group"; }
|
| GROUP { $$ = "group"; }
|
||||||
| HAVING { $$ = "having"; }
|
| HAVING { $$ = "having"; }
|
||||||
| ILIKE { $$ = "ilike"; }
|
| ILIKE { $$ = "ilike"; }
|
||||||
| IN { $$ = "in"; }
|
| IN { $$ = "in"; }
|
||||||
| INITIALLY { $$ = "initially"; }
|
| INITIALLY { $$ = "initially"; }
|
||||||
| INNER_P { $$ = "inner"; }
|
| INNER_P { $$ = "inner"; }
|
||||||
| INOUT { $$ = "inout"; }
|
|
||||||
| INTERSECT { $$ = "intersect"; }
|
| INTERSECT { $$ = "intersect"; }
|
||||||
| INTERVAL { $$ = "interval"; }
|
|
||||||
| INTO { $$ = "into"; }
|
| INTO { $$ = "into"; }
|
||||||
| IS { $$ = "is"; }
|
| IS { $$ = "is"; }
|
||||||
| ISNULL { $$ = "isnull"; }
|
| ISNULL { $$ = "isnull"; }
|
||||||
@ -5918,19 +5910,12 @@ ColLabel: ColId { $$ = $1; }
|
|||||||
| LEFT { $$ = "left"; }
|
| LEFT { $$ = "left"; }
|
||||||
| LIKE { $$ = "like"; }
|
| LIKE { $$ = "like"; }
|
||||||
| LIMIT { $$ = "limit"; }
|
| LIMIT { $$ = "limit"; }
|
||||||
| LISTEN { $$ = "listen"; }
|
|
||||||
| LOAD { $$ = "load"; }
|
|
||||||
| LOCAL { $$ = "local"; }
|
|
||||||
| LOCK_P { $$ = "lock"; }
|
|
||||||
| MOVE { $$ = "move"; }
|
|
||||||
| NATURAL { $$ = "natural"; }
|
| NATURAL { $$ = "natural"; }
|
||||||
| NCHAR { $$ = "nchar"; }
|
|
||||||
| NEW { $$ = "new"; }
|
| NEW { $$ = "new"; }
|
||||||
| NOT { $$ = "not"; }
|
| NOT { $$ = "not"; }
|
||||||
| NOTNULL { $$ = "notnull"; }
|
| NOTNULL { $$ = "notnull"; }
|
||||||
| NULLIF { $$ = "nullif"; }
|
| NULLIF { $$ = "nullif"; }
|
||||||
| NULL_P { $$ = "null"; }
|
| NULL_P { $$ = "null"; }
|
||||||
| NUMERIC { $$ = "numeric"; }
|
|
||||||
| OFF { $$ = "off"; }
|
| OFF { $$ = "off"; }
|
||||||
| OFFSET { $$ = "offset"; }
|
| OFFSET { $$ = "offset"; }
|
||||||
| OLD { $$ = "old"; }
|
| OLD { $$ = "old"; }
|
||||||
@ -5938,43 +5923,66 @@ ColLabel: ColId { $$ = $1; }
|
|||||||
| ONLY { $$ = "only"; }
|
| ONLY { $$ = "only"; }
|
||||||
| OR { $$ = "or"; }
|
| OR { $$ = "or"; }
|
||||||
| ORDER { $$ = "order"; }
|
| ORDER { $$ = "order"; }
|
||||||
| OUT { $$ = "out"; }
|
|
||||||
| OUTER_P { $$ = "outer"; }
|
| OUTER_P { $$ = "outer"; }
|
||||||
| OVERLAPS { $$ = "overlaps"; }
|
| OVERLAPS { $$ = "overlaps"; }
|
||||||
| POSITION { $$ = "position"; }
|
| POSITION { $$ = "position"; }
|
||||||
| PRECISION { $$ = "precision"; }
|
|
||||||
| PRIMARY { $$ = "primary"; }
|
| PRIMARY { $$ = "primary"; }
|
||||||
| PUBLIC { $$ = "public"; }
|
| PUBLIC { $$ = "public"; }
|
||||||
| REFERENCES { $$ = "references"; }
|
| REFERENCES { $$ = "references"; }
|
||||||
| RESET { $$ = "reset"; }
|
|
||||||
| RIGHT { $$ = "right"; }
|
| RIGHT { $$ = "right"; }
|
||||||
| SELECT { $$ = "select"; }
|
| SELECT { $$ = "select"; }
|
||||||
| SESSION_USER { $$ = "session_user"; }
|
| SESSION_USER { $$ = "session_user"; }
|
||||||
| SETOF { $$ = "setof"; }
|
|
||||||
| SHOW { $$ = "show"; }
|
|
||||||
| SOME { $$ = "some"; }
|
| SOME { $$ = "some"; }
|
||||||
| SUBSTRING { $$ = "substring"; }
|
| SUBSTRING { $$ = "substring"; }
|
||||||
| TABLE { $$ = "table"; }
|
| TABLE { $$ = "table"; }
|
||||||
| THEN { $$ = "then"; }
|
| THEN { $$ = "then"; }
|
||||||
| TIME { $$ = "time"; }
|
|
||||||
| TIMESTAMP { $$ = "timestamp"; }
|
|
||||||
| TO { $$ = "to"; }
|
| TO { $$ = "to"; }
|
||||||
| TRAILING { $$ = "trailing"; }
|
| TRAILING { $$ = "trailing"; }
|
||||||
| TRANSACTION { $$ = "transaction"; }
|
|
||||||
| TRIM { $$ = "trim"; }
|
| TRIM { $$ = "trim"; }
|
||||||
| TRUE_P { $$ = "true"; }
|
| TRUE_P { $$ = "true"; }
|
||||||
| UNION { $$ = "union"; }
|
| UNION { $$ = "union"; }
|
||||||
| UNIQUE { $$ = "unique"; }
|
| UNIQUE { $$ = "unique"; }
|
||||||
| UNKNOWN { $$ = "unknown"; }
|
|
||||||
| USER { $$ = "user"; }
|
| USER { $$ = "user"; }
|
||||||
| USING { $$ = "using"; }
|
| USING { $$ = "using"; }
|
||||||
| VACUUM { $$ = "vacuum"; }
|
|
||||||
| VARCHAR { $$ = "varchar"; }
|
|
||||||
| VERBOSE { $$ = "verbose"; }
|
| VERBOSE { $$ = "verbose"; }
|
||||||
| WHEN { $$ = "when"; }
|
| WHEN { $$ = "when"; }
|
||||||
| WHERE { $$ = "where"; }
|
| WHERE { $$ = "where"; }
|
||||||
;
|
;
|
||||||
|
|
||||||
|
/* Function identifier --- names that can be function names.
|
||||||
|
*
|
||||||
|
* This contains the TypeFuncId list plus some ColLabel keywords
|
||||||
|
* that are used as operators in expressions; in general such keywords
|
||||||
|
* can't be ColId because they would be ambiguous with variable names,
|
||||||
|
* but they are unambiguous as function identifiers.
|
||||||
|
*
|
||||||
|
* Do not include POSITION, SUBSTRING, etc here since they have explicit
|
||||||
|
* productions in a_expr to support the goofy SQL9x argument syntax.
|
||||||
|
* - thomas 2000-11-28
|
||||||
|
*/
|
||||||
|
func_name: TypeFuncId { $$ = xlateSqlFunc($1); }
|
||||||
|
| BETWEEN { $$ = xlateSqlFunc("between"); }
|
||||||
|
| BINARY { $$ = xlateSqlFunc("binary"); }
|
||||||
|
| CROSS { $$ = xlateSqlFunc("cross"); }
|
||||||
|
| FREEZE { $$ = xlateSqlFunc("freeze"); }
|
||||||
|
| FULL { $$ = xlateSqlFunc("full"); }
|
||||||
|
| ILIKE { $$ = xlateSqlFunc("ilike"); }
|
||||||
|
| IN { $$ = xlateSqlFunc("in"); }
|
||||||
|
| INNER_P { $$ = xlateSqlFunc("inner"); }
|
||||||
|
| IS { $$ = xlateSqlFunc("is"); }
|
||||||
|
| ISNULL { $$ = xlateSqlFunc("isnull"); }
|
||||||
|
| JOIN { $$ = xlateSqlFunc("join"); }
|
||||||
|
| LEFT { $$ = xlateSqlFunc("left"); }
|
||||||
|
| LIKE { $$ = xlateSqlFunc("like"); }
|
||||||
|
| NATURAL { $$ = xlateSqlFunc("natural"); }
|
||||||
|
| NOTNULL { $$ = xlateSqlFunc("notnull"); }
|
||||||
|
| OUTER_P { $$ = xlateSqlFunc("outer"); }
|
||||||
|
| OVERLAPS { $$ = xlateSqlFunc("overlaps"); }
|
||||||
|
| PUBLIC { $$ = xlateSqlFunc("public"); }
|
||||||
|
| RIGHT { $$ = xlateSqlFunc("right"); }
|
||||||
|
| VERBOSE { $$ = xlateSqlFunc("verbose"); }
|
||||||
|
;
|
||||||
|
|
||||||
SpecialRuleRelation: OLD
|
SpecialRuleRelation: OLD
|
||||||
{
|
{
|
||||||
if (QueryIsRule)
|
if (QueryIsRule)
|
||||||
|
@ -88,7 +88,7 @@ cat_str(int count, ...)
|
|||||||
char *
|
char *
|
||||||
make_str(const char *str)
|
make_str(const char *str)
|
||||||
{
|
{
|
||||||
char * res_str = (char *)mm_alloc(strlen(str) + 1);
|
char * res_str = (char *)mm_alloc(strlen(str) + 1);
|
||||||
|
|
||||||
strcpy(res_str, str);
|
strcpy(res_str, str);
|
||||||
return res_str;
|
return res_str;
|
||||||
@ -279,7 +279,7 @@ make_name(void)
|
|||||||
%type <str> key_match ColLabel SpecialRuleRelation ColId columnDef
|
%type <str> key_match ColLabel SpecialRuleRelation ColId columnDef
|
||||||
%type <str> ColConstraint ColConstraintElem drop_type Bitconst
|
%type <str> ColConstraint ColConstraintElem drop_type Bitconst
|
||||||
%type <str> OptTableElementList OptTableElement TableConstraint
|
%type <str> OptTableElementList OptTableElement TableConstraint
|
||||||
%type <str> ConstraintElem key_actions ColQualList TokenId DropSchemaStmt
|
%type <str> ConstraintElem key_actions ColQualList TypeFuncId DropSchemaStmt
|
||||||
%type <str> target_list target_el update_target_list alias_clause
|
%type <str> target_list target_el update_target_list alias_clause
|
||||||
%type <str> update_target_el opt_id relation_name database_name
|
%type <str> update_target_el opt_id relation_name database_name
|
||||||
%type <str> access_method attr_name class index_name name func_name
|
%type <str> access_method attr_name class index_name name func_name
|
||||||
@ -288,9 +288,9 @@ make_name(void)
|
|||||||
%type <str> opt_indirection expr_list extract_list extract_arg
|
%type <str> opt_indirection expr_list extract_list extract_arg
|
||||||
%type <str> position_list substr_list substr_from alter_column_default
|
%type <str> position_list substr_list substr_from alter_column_default
|
||||||
%type <str> trim_list in_expr substr_for attr attrs drop_behavior
|
%type <str> trim_list in_expr substr_for attr attrs drop_behavior
|
||||||
%type <str> Typename SimpleTypename Generic Numeric generic opt_float opt_numeric
|
%type <str> Typename SimpleTypename Generic Numeric opt_float opt_numeric
|
||||||
%type <str> opt_decimal Character character opt_varying opt_charset
|
%type <str> opt_decimal Character character opt_varying opt_charset
|
||||||
%type <str> opt_collate datetime opt_timezone opt_interval table_ref
|
%type <str> opt_collate opt_timezone opt_interval table_ref
|
||||||
%type <str> row_expr row_descriptor row_list ConstDatetime opt_chain
|
%type <str> row_expr row_descriptor row_list ConstDatetime opt_chain
|
||||||
%type <str> SelectStmt into_clause OptTemp ConstraintAttributeSpec
|
%type <str> SelectStmt into_clause OptTemp ConstraintAttributeSpec
|
||||||
%type <str> opt_table opt_all sort_clause sortby_list ConstraintAttr
|
%type <str> opt_table opt_all sort_clause sortby_list ConstraintAttr
|
||||||
@ -324,7 +324,7 @@ make_name(void)
|
|||||||
%type <str> TriggerActionTime CreateTrigStmt DropPLangStmt
|
%type <str> TriggerActionTime CreateTrigStmt DropPLangStmt
|
||||||
%type <str> CreatePLangStmt TriggerFuncArgs TriggerFuncArg simple_select
|
%type <str> CreatePLangStmt TriggerFuncArgs TriggerFuncArg simple_select
|
||||||
%type <str> ViewStmt LoadStmt CreatedbStmt createdb_opt_item
|
%type <str> ViewStmt LoadStmt CreatedbStmt createdb_opt_item
|
||||||
%type <str> createdb_opt_list opt_encoding OptInherit Geometric
|
%type <str> createdb_opt_list opt_encoding OptInherit
|
||||||
%type <str> DropdbStmt ClusterStmt grantee RevokeStmt Bit bit
|
%type <str> DropdbStmt ClusterStmt grantee RevokeStmt Bit bit
|
||||||
%type <str> GrantStmt privileges operation_commalist operation PosAllConst
|
%type <str> GrantStmt privileges operation_commalist operation PosAllConst
|
||||||
%type <str> opt_with_grant opt_cursor ConstraintsSetStmt AllConst
|
%type <str> opt_with_grant opt_cursor ConstraintsSetStmt AllConst
|
||||||
@ -357,12 +357,12 @@ make_name(void)
|
|||||||
%type <str> struct_type s_struct declaration declarations variable_declarations
|
%type <str> struct_type s_struct declaration declarations variable_declarations
|
||||||
%type <str> s_union union_type ECPGSetAutocommit on_off
|
%type <str> s_union union_type ECPGSetAutocommit on_off
|
||||||
%type <str> ECPGAllocateDescr ECPGDeallocateDescr symbol opt_symbol
|
%type <str> ECPGAllocateDescr ECPGDeallocateDescr symbol opt_symbol
|
||||||
%type <str> ECPGGetDescriptorHeader ECPGColLabel ECPGTypeName
|
%type <str> ECPGGetDescriptorHeader ECPGTypeFuncId ECPGColId ECPGColLabel
|
||||||
%type <str> ECPGLabelTypeName ECPGColId variablelist cvariable
|
%type <str> ECPGTypeName variablelist cvariable
|
||||||
|
|
||||||
%type <descriptor> ECPGGetDescriptor
|
%type <descriptor> ECPGGetDescriptor
|
||||||
|
|
||||||
%type <type_enum> simple_type signed_type unsigned_type varchar_type
|
%type <type_enum> simple_type signed_type unsigned_type
|
||||||
|
|
||||||
%type <dtype_enum> descriptor_item desc_header_item
|
%type <dtype_enum> descriptor_item desc_header_item
|
||||||
|
|
||||||
@ -913,11 +913,11 @@ constraints_set_list: ALL
|
|||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
constraints_set_namelist: IDENT
|
constraints_set_namelist: ColId
|
||||||
{
|
{
|
||||||
$$ = $1;
|
$$ = $1;
|
||||||
}
|
}
|
||||||
| constraints_set_namelist ',' IDENT
|
| constraints_set_namelist ',' ColId
|
||||||
{
|
{
|
||||||
$$ = cat_str(3, $1, make_str(","), $3);
|
$$ = cat_str(3, $1, make_str(","), $3);
|
||||||
}
|
}
|
||||||
@ -1529,8 +1529,8 @@ def_elem: ColLabel '=' def_arg {
|
|||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
/* Note: any simple identifier will be returned as a type name! */
|
||||||
def_arg: func_return { $$ = $1; }
|
def_arg: func_return { $$ = $1; }
|
||||||
| TokenId { $$ = $1; }
|
|
||||||
| all_Op { $$ = $1; }
|
| all_Op { $$ = $1; }
|
||||||
| AllConst { $$ = $1; }
|
| AllConst { $$ = $1; }
|
||||||
;
|
;
|
||||||
@ -1964,7 +1964,7 @@ func_type: Typename
|
|||||||
{
|
{
|
||||||
$$ = $1;
|
$$ = $1;
|
||||||
}
|
}
|
||||||
| IDENT '.' ColId '%' TYPE_P
|
| TypeFuncId '.' ColId '%' TYPE_P
|
||||||
{
|
{
|
||||||
$$ = cat_str(4, $1, make_str("."), $3, make_str("% type"));
|
$$ = cat_str(4, $1, make_str("."), $3, make_str("% type"));
|
||||||
}
|
}
|
||||||
@ -2974,20 +2974,11 @@ SimpleTypename: ConstTypename { $$ = $1; }
|
|||||||
ConstTypename: Generic { $$ = $1; }
|
ConstTypename: Generic { $$ = $1; }
|
||||||
| ConstDatetime { $$ = $1; }
|
| ConstDatetime { $$ = $1; }
|
||||||
| Numeric { $$ = $1; }
|
| Numeric { $$ = $1; }
|
||||||
| Geometric { $$ = $1; }
|
|
||||||
| Bit { $$ = $1; }
|
| Bit { $$ = $1; }
|
||||||
| Character { $$ = $1; }
|
| Character { $$ = $1; }
|
||||||
;
|
;
|
||||||
|
|
||||||
Generic: generic
|
Generic: TypeFuncId { $$ = $1; }
|
||||||
{
|
|
||||||
$$ = $1;
|
|
||||||
}
|
|
||||||
;
|
|
||||||
|
|
||||||
generic: ident { $$ = $1; }
|
|
||||||
| TYPE_P { $$ = make_str("type"); }
|
|
||||||
| ECPGKeywords { $$ = $1; }
|
|
||||||
| ECPGTypeName { $$ = $1; }
|
| ECPGTypeName { $$ = $1; }
|
||||||
;
|
;
|
||||||
|
|
||||||
@ -3018,8 +3009,6 @@ Numeric: FLOAT opt_float
|
|||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
Geometric: PATH_P { $$ = make_str("path"); };
|
|
||||||
|
|
||||||
opt_float: '(' PosIntConst ')'
|
opt_float: '(' PosIntConst ')'
|
||||||
{
|
{
|
||||||
$$ = cat_str(3, make_str("("), $2, make_str(")"));
|
$$ = cat_str(3, make_str("("), $2, make_str(")"));
|
||||||
@ -3115,11 +3104,7 @@ opt_collate: COLLATE ColId { $$ = cat2_str(make_str("collate"), $2); }
|
|||||||
| /*EMPTY*/ { $$ = EMPTY; }
|
| /*EMPTY*/ { $$ = EMPTY; }
|
||||||
;
|
;
|
||||||
|
|
||||||
ConstDatetime: datetime
|
ConstDatetime: TIMESTAMP '(' PosIntConst ')' opt_timezone
|
||||||
{
|
|
||||||
$$ = $1;
|
|
||||||
}
|
|
||||||
| TIMESTAMP '(' PosIntConst ')' opt_timezone
|
|
||||||
{
|
{
|
||||||
$$ = cat_str(4, make_str("timestamp("), $3, make_str(")"), $5);
|
$$ = cat_str(4, make_str("timestamp("), $3, make_str(")"), $5);
|
||||||
}
|
}
|
||||||
@ -3143,14 +3128,6 @@ ConstInterval: INTERVAL
|
|||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
datetime: YEAR_P { $$ = make_str("year"); }
|
|
||||||
| MONTH_P { $$ = make_str("month"); }
|
|
||||||
| DAY_P { $$ = make_str("day"); }
|
|
||||||
| HOUR_P { $$ = make_str("hour"); }
|
|
||||||
| MINUTE_P { $$ = make_str("minute"); }
|
|
||||||
| SECOND_P { $$ = make_str("second"); }
|
|
||||||
;
|
|
||||||
|
|
||||||
opt_timezone: WITH TIME ZONE { $$ = make_str("with time zone"); }
|
opt_timezone: WITH TIME ZONE { $$ = make_str("with time zone"); }
|
||||||
| WITHOUT TIME ZONE { $$ = make_str("without time zone"); }
|
| WITHOUT TIME ZONE { $$ = make_str("without time zone"); }
|
||||||
| /*EMPTY*/ { $$ = EMPTY; }
|
| /*EMPTY*/ { $$ = EMPTY; }
|
||||||
@ -3544,9 +3521,14 @@ extract_list: extract_arg FROM a_expr
|
|||||||
* - thomas 2001-04-12
|
* - thomas 2001-04-12
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extract_arg: datetime { $$ = $1; }
|
extract_arg: IDENT { $$ = $1; }
|
||||||
| StringConst { $$ = $1; }
|
| YEAR_P { $$ = make_str("year"); }
|
||||||
| IDENT { $$ = $1; }
|
| MONTH_P { $$ = make_str("month"); }
|
||||||
|
| DAY_P { $$ = make_str("day"); }
|
||||||
|
| HOUR_P { $$ = make_str("hour"); }
|
||||||
|
| MINUTE_P { $$ = make_str("minute"); }
|
||||||
|
| SECOND_P { $$ = make_str("second"); }
|
||||||
|
| StringConst { $$ = $1; }
|
||||||
;
|
;
|
||||||
|
|
||||||
/* position_list uses b_expr not a_expr to avoid conflict with general IN */
|
/* position_list uses b_expr not a_expr to avoid conflict with general IN */
|
||||||
@ -3750,22 +3732,6 @@ attr_name: ColId { $$ = $1; };
|
|||||||
class: ColId { $$ = $1; };
|
class: ColId { $$ = $1; };
|
||||||
index_name: ColId { $$ = $1; };
|
index_name: ColId { $$ = $1; };
|
||||||
|
|
||||||
/* Functions
|
|
||||||
* Include date/time keywords as SQL92 extension.
|
|
||||||
* Include TYPE as a SQL92 unreserved keyword. - thomas 1997-10-05
|
|
||||||
*/
|
|
||||||
func_name: ColId { $$ = $1; };
|
|
||||||
| BETWEEN { $$ = make_str("between");}
|
|
||||||
| ILIKE { $$ = make_str("ilike");}
|
|
||||||
| IN { $$ = make_str("in");}
|
|
||||||
| IS { $$ = make_str("is");}
|
|
||||||
| ISNULL { $$ = make_str("isnull");}
|
|
||||||
| LIKE { $$ = make_str("like");}
|
|
||||||
| NOTNULL { $$ = make_str("notnull");}
|
|
||||||
| OVERLAPS { $$ = make_str("overlaps");}
|
|
||||||
;
|
|
||||||
|
|
||||||
|
|
||||||
file_name: StringConst { $$ = $1; };
|
file_name: StringConst { $$ = $1; };
|
||||||
|
|
||||||
/* Constants
|
/* Constants
|
||||||
@ -3859,26 +3825,6 @@ PosAllConst: Sconst { $$ = $1; }
|
|||||||
|
|
||||||
UserId: ColId { $$ = $1;};
|
UserId: ColId { $$ = $1;};
|
||||||
|
|
||||||
/* Column identifier
|
|
||||||
*/
|
|
||||||
ColId: ECPGColId { $$ = $1; }
|
|
||||||
/* | ECPGTypeName { $$ = $1; }*/
|
|
||||||
;
|
|
||||||
|
|
||||||
/* Column label
|
|
||||||
* Allowed labels in "AS" clauses.
|
|
||||||
* Include TRUE/FALSE SQL3 reserved words for Postgres backward
|
|
||||||
* compatibility. Cannot allow this for column names since the
|
|
||||||
* syntax would not distinguish between the constant value and
|
|
||||||
* a column name. - thomas 1997-10-24
|
|
||||||
* Add other keywords to this list. Note that they appear here
|
|
||||||
* rather than in ColId if there was a shift/reduce conflict
|
|
||||||
* when used as a full identifier. - thomas 1997-11-06
|
|
||||||
*/
|
|
||||||
ColLabel: ECPGLabelTypeName { $$ = $1; }
|
|
||||||
| ECPGColLabel { $$ = $1; }
|
|
||||||
;
|
|
||||||
|
|
||||||
SpecialRuleRelation: OLD
|
SpecialRuleRelation: OLD
|
||||||
{
|
{
|
||||||
if (!QueryIsRule)
|
if (!QueryIsRule)
|
||||||
@ -4220,13 +4166,6 @@ type: simple_type
|
|||||||
$$.type_dimension = -1;
|
$$.type_dimension = -1;
|
||||||
$$.type_index = -1;
|
$$.type_index = -1;
|
||||||
}
|
}
|
||||||
| varchar_type
|
|
||||||
{
|
|
||||||
$$.type_enum = ECPGt_varchar;
|
|
||||||
$$.type_str = make_str("varchar");;
|
|
||||||
$$.type_dimension = -1;
|
|
||||||
$$.type_index = -1;
|
|
||||||
}
|
|
||||||
| struct_type
|
| struct_type
|
||||||
{
|
{
|
||||||
$$.type_enum = ECPGt_struct;
|
$$.type_enum = ECPGt_struct;
|
||||||
@ -4250,14 +4189,42 @@ type: simple_type
|
|||||||
}
|
}
|
||||||
| ECPGColLabel
|
| ECPGColLabel
|
||||||
{
|
{
|
||||||
/* this is for typedef'ed types */
|
/*
|
||||||
struct typedefs *this = get_typedef($1);
|
* Check for type names that the SQL grammar treats as
|
||||||
|
* unreserved keywords
|
||||||
|
*/
|
||||||
|
if (strcmp($1, "varchar") == 0)
|
||||||
|
{
|
||||||
|
$$.type_enum = ECPGt_varchar;
|
||||||
|
$$.type_str = make_str("varchar");
|
||||||
|
$$.type_dimension = -1;
|
||||||
|
$$.type_index = -1;
|
||||||
|
}
|
||||||
|
else if (strcmp($1, "float") == 0)
|
||||||
|
{
|
||||||
|
$$.type_enum = ECPGt_float;
|
||||||
|
$$.type_str = make_str("float");
|
||||||
|
$$.type_dimension = -1;
|
||||||
|
$$.type_index = -1;
|
||||||
|
}
|
||||||
|
else if (strcmp($1, "double") == 0)
|
||||||
|
{
|
||||||
|
$$.type_enum = ECPGt_double;
|
||||||
|
$$.type_str = make_str("double");
|
||||||
|
$$.type_dimension = -1;
|
||||||
|
$$.type_index = -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* this is for typedef'ed types */
|
||||||
|
struct typedefs *this = get_typedef($1);
|
||||||
|
|
||||||
$$.type_str = (this->type->type_enum == ECPGt_varchar) ? EMPTY : mm_strdup(this->name);
|
$$.type_str = (this->type->type_enum == ECPGt_varchar) ? EMPTY : mm_strdup(this->name);
|
||||||
$$.type_enum = this->type->type_enum;
|
$$.type_enum = this->type->type_enum;
|
||||||
$$.type_dimension = this->type->type_dimension;
|
$$.type_dimension = this->type->type_dimension;
|
||||||
$$.type_index = this->type->type_index;
|
$$.type_index = this->type->type_index;
|
||||||
struct_member_list[struct_level] = ECPGstruct_member_dup(this->struct_member_list);
|
struct_member_list[struct_level] = ECPGstruct_member_dup(this->struct_member_list);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
@ -4359,9 +4326,7 @@ signed_type: SQL_SHORT { $$ = ECPGt_short; }
|
|||||||
$$ = ECPGt_long;
|
$$ = ECPGt_long;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
| SQL_BOOL { $$ = ECPGt_bool; };
|
| SQL_BOOL { $$ = ECPGt_bool; }
|
||||||
| FLOAT { $$ = ECPGt_float; }
|
|
||||||
| DOUBLE { $$ = ECPGt_double; }
|
|
||||||
| CHAR { $$ = ECPGt_char; }
|
| CHAR { $$ = ECPGt_char; }
|
||||||
;
|
;
|
||||||
|
|
||||||
@ -4369,8 +4334,6 @@ opt_signed: SQL_SIGNED
|
|||||||
| /* EMPTY */
|
| /* EMPTY */
|
||||||
;
|
;
|
||||||
|
|
||||||
varchar_type: VARCHAR { $$ = ECPGt_varchar; };
|
|
||||||
|
|
||||||
variable_list: variable
|
variable_list: variable
|
||||||
{
|
{
|
||||||
$$ = $1;
|
$$ = $1;
|
||||||
@ -4686,7 +4649,7 @@ ECPGSetConnection: SET SQL_CONNECTION to_equal connection_object
|
|||||||
/*
|
/*
|
||||||
* define a new type for embedded SQL
|
* define a new type for embedded SQL
|
||||||
*/
|
*/
|
||||||
ECPGTypedef: TYPE_P ECPGColLabel IS type opt_type_array_bounds opt_reference
|
ECPGTypedef: TYPE_P ColLabel IS type opt_type_array_bounds opt_reference
|
||||||
{
|
{
|
||||||
/* add entry to list */
|
/* add entry to list */
|
||||||
struct typedefs *ptr, *this;
|
struct typedefs *ptr, *this;
|
||||||
@ -4779,7 +4742,7 @@ opt_reference: SQL_REFERENCE { $$ = make_str("reference"); }
|
|||||||
/*
|
/*
|
||||||
* define the type of one variable for embedded SQL
|
* define the type of one variable for embedded SQL
|
||||||
*/
|
*/
|
||||||
ECPGVar: SQL_VAR ECPGColLabel IS type opt_type_array_bounds opt_reference
|
ECPGVar: SQL_VAR ColLabel IS type opt_type_array_bounds opt_reference
|
||||||
{
|
{
|
||||||
struct variable *p = find_variable($2);
|
struct variable *p = find_variable($2);
|
||||||
int dimension = $5.index1;
|
int dimension = $5.index1;
|
||||||
@ -4956,16 +4919,6 @@ ECPGTypeName: SQL_BOOL { $$ = make_str("bool"); }
|
|||||||
| SQL_STRUCT { $$ = make_str("struct"); }
|
| SQL_STRUCT { $$ = make_str("struct"); }
|
||||||
| SQL_SIGNED { $$ = make_str("signed"); }
|
| SQL_SIGNED { $$ = make_str("signed"); }
|
||||||
| SQL_UNSIGNED { $$ = make_str("unsigned"); }
|
| SQL_UNSIGNED { $$ = make_str("unsigned"); }
|
||||||
| DOUBLE { $$ = make_str("double"); }
|
|
||||||
;
|
|
||||||
|
|
||||||
/* not needed at the moment
|
|
||||||
* | UNION { $$ = make_str("union"); }
|
|
||||||
*/
|
|
||||||
ECPGLabelTypeName: CHAR { $$ = make_str("char"); }
|
|
||||||
| FLOAT { $$ = make_str("float"); }
|
|
||||||
| VARCHAR { $$ = make_str("varchar"); }
|
|
||||||
/* | ECPGTypeName { $$ = $1; }*/
|
|
||||||
;
|
;
|
||||||
|
|
||||||
opt_symbol: symbol { $$ = $1; }
|
opt_symbol: symbol { $$ = $1; }
|
||||||
@ -4974,258 +4927,352 @@ opt_symbol: symbol { $$ = $1; }
|
|||||||
|
|
||||||
symbol: ColLabel { $$ = $1; };
|
symbol: ColLabel { $$ = $1; };
|
||||||
|
|
||||||
/* Parser tokens to be used as identifiers.
|
/*
|
||||||
* Tokens involving data types should appear in ColId only,
|
* Keyword classification lists. Generally, every keyword present in
|
||||||
* since they will conflict with real TypeName productions.
|
* the Postgres grammar should be in one of these lists. (Presently,
|
||||||
|
* "AS" is the sole exception: it is our only completely-reserved word.)
|
||||||
|
*
|
||||||
|
* Put a new keyword into the earliest list (of TypeFuncId, ColId, ColLabel)
|
||||||
|
* that it can go into without creating shift or reduce conflicts. The
|
||||||
|
* earlier lists define "less reserved" categories of keywords. Notice that
|
||||||
|
* each list includes by reference the ones before it.
|
||||||
*/
|
*/
|
||||||
TokenId: ABSOLUTE { $$ = make_str("absolute"); }
|
|
||||||
| ACCESS { $$ = make_str("access"); }
|
|
||||||
| ACTION { $$ = make_str("action"); }
|
|
||||||
| ADD { $$ = make_str("add"); }
|
|
||||||
| AFTER { $$ = make_str("after"); }
|
|
||||||
| AGGREGATE { $$ = make_str("aggregate"); }
|
|
||||||
| ALTER { $$ = make_str("alter"); }
|
|
||||||
| AT { $$ = make_str("at"); }
|
|
||||||
| AUTHORIZATION { $$ = make_str("authorization"); }
|
|
||||||
| BACKWARD { $$ = make_str("backward"); }
|
|
||||||
| BEFORE { $$ = make_str("before"); }
|
|
||||||
| BEGIN_TRANS { $$ = make_str("begin"); }
|
|
||||||
| CACHE { $$ = make_str("cache"); }
|
|
||||||
| CASCADE { $$ = make_str("cascade"); }
|
|
||||||
| CHAIN { $$ = make_str("chain"); }
|
|
||||||
| CHARACTERISTICS { $$ = make_str("characteristics"); }
|
|
||||||
| CHECKPOINT { $$ = make_str("checkpoint"); }
|
|
||||||
| CLOSE { $$ = make_str("close"); }
|
|
||||||
| COMMENT { $$ = make_str("comment"); }
|
|
||||||
| COMMIT { $$ = make_str("commit"); }
|
|
||||||
| COMMITTED { $$ = make_str("committed"); }
|
|
||||||
| CONSTRAINTS { $$ = make_str("constraints"); }
|
|
||||||
| CREATEDB { $$ = make_str("createdb"); }
|
|
||||||
| CREATEUSER { $$ = make_str("createuser"); }
|
|
||||||
| CYCLE { $$ = make_str("cycle"); }
|
|
||||||
| DATABASE { $$ = make_str("database"); }
|
|
||||||
| DECLARE { $$ = make_str("declare"); }
|
|
||||||
| DEFERRED { $$ = make_str("deferred"); }
|
|
||||||
| DELETE { $$ = make_str("delete"); }
|
|
||||||
| DELIMITERS { $$ = make_str("delimiters"); }
|
|
||||||
| DROP { $$ = make_str("drop"); }
|
|
||||||
| EACH { $$ = make_str("each"); }
|
|
||||||
| ENCODING { $$ = make_str("encoding"); }
|
|
||||||
| ENCRYPTED { $$ = make_str("encrypted"); }
|
|
||||||
| ESCAPE { $$ = make_str("escape"); }
|
|
||||||
| EXCLUSIVE { $$ = make_str("exclusive"); }
|
|
||||||
| EXECUTE { $$ = make_str("execute"); }
|
|
||||||
| FETCH { $$ = make_str("fetch"); }
|
|
||||||
| FORCE { $$ = make_str("force"); }
|
|
||||||
| FORWARD { $$ = make_str("forward"); }
|
|
||||||
| FUNCTION { $$ = make_str("function"); }
|
|
||||||
| GRANT { $$ = make_str("grant"); }
|
|
||||||
| HANDLER { $$ = make_str("handler"); }
|
|
||||||
| IMMEDIATE { $$ = make_str("immediate"); }
|
|
||||||
| INCREMENT { $$ = make_str("increment"); }
|
|
||||||
| INDEX { $$ = make_str("index"); }
|
|
||||||
| INHERITS { $$ = make_str("inherits"); }
|
|
||||||
| INSENSITIVE { $$ = make_str("insensitive"); }
|
|
||||||
| INSERT { $$ = make_str("insert"); }
|
|
||||||
| INSTEAD { $$ = make_str("instead"); }
|
|
||||||
| ISOLATION { $$ = make_str("isolation"); }
|
|
||||||
| KEY { $$ = make_str("key"); }
|
|
||||||
| LANGUAGE { $$ = make_str("language"); }
|
|
||||||
| LANCOMPILER { $$ = make_str("lancompiler"); }
|
|
||||||
| LEVEL { $$ = make_str("level"); }
|
|
||||||
| LOCATION { $$ = make_str("location"); }
|
|
||||||
| MATCH { $$ = make_str("match"); }
|
|
||||||
| MAXVALUE { $$ = make_str("maxvalue"); }
|
|
||||||
| MINVALUE { $$ = make_str("minvalue"); }
|
|
||||||
| MODE { $$ = make_str("mode"); }
|
|
||||||
| NAMES { $$ = make_str("names"); }
|
|
||||||
| NEXT { $$ = make_str("next"); }
|
|
||||||
| NO { $$ = make_str("no"); }
|
|
||||||
| NOCREATEDB { $$ = make_str("nocreatedb"); }
|
|
||||||
| NOCREATEUSER { $$ = make_str("nocreateuser"); }
|
|
||||||
| NOTHING { $$ = make_str("nothing"); }
|
|
||||||
| NOTIFY { $$ = make_str("notify"); }
|
|
||||||
| OF { $$ = make_str("of"); }
|
|
||||||
| OIDS { $$ = make_str("oids"); }
|
|
||||||
| OPERATOR { $$ = make_str("operator"); }
|
|
||||||
| OPTION { $$ = make_str("option"); }
|
|
||||||
| OWNER { $$ = make_str("owner"); }
|
|
||||||
| PARTIAL { $$ = make_str("partial"); }
|
|
||||||
| PASSWORD { $$ = make_str("password"); }
|
|
||||||
| PENDANT { $$ = make_str("pendant"); }
|
|
||||||
| PRIOR { $$ = make_str("prior"); }
|
|
||||||
| PRIVILEGES { $$ = make_str("privileges"); }
|
|
||||||
| PROCEDURAL { $$ = make_str("procedural"); }
|
|
||||||
| PROCEDURE { $$ = make_str("procedure"); }
|
|
||||||
| READ { $$ = make_str("read"); }
|
|
||||||
| REINDEX { $$ = make_str("reindex"); }
|
|
||||||
| RELATIVE { $$ = make_str("relative"); }
|
|
||||||
| RENAME { $$ = make_str("rename"); }
|
|
||||||
| REPLACE { $$ = make_str("replace"); }
|
|
||||||
| RESTRICT { $$ = make_str("restrict"); }
|
|
||||||
| RETURNS { $$ = make_str("returns"); }
|
|
||||||
| REVOKE { $$ = make_str("revoke"); }
|
|
||||||
| ROLLBACK { $$ = make_str("rollback"); }
|
|
||||||
| ROW { $$ = make_str("row"); }
|
|
||||||
| RULE { $$ = make_str("rule"); }
|
|
||||||
| SCHEMA { $$ = make_str("schema"); }
|
|
||||||
| SCROLL { $$ = make_str("scroll"); }
|
|
||||||
| SESSION { $$ = make_str("session"); }
|
|
||||||
| SEQUENCE { $$ = make_str("sequence"); }
|
|
||||||
| SERIALIZABLE { $$ = make_str("serializable"); }
|
|
||||||
| SET { $$ = make_str("set"); }
|
|
||||||
| SHARE { $$ = make_str("share"); }
|
|
||||||
| START { $$ = make_str("start"); }
|
|
||||||
| STATEMENT { $$ = make_str("statement"); }
|
|
||||||
| STATISTICS { $$ = make_str("statistics"); }
|
|
||||||
| STDIN { $$ = make_str("stdin"); }
|
|
||||||
| STDOUT { $$ = make_str("stdout"); }
|
|
||||||
| SYSID { $$ = make_str("sysid"); }
|
|
||||||
| TEMP { $$ = make_str("temp"); }
|
|
||||||
| TEMPLATE { $$ = make_str("template"); }
|
|
||||||
| TEMPORARY { $$ = make_str("temporary"); }
|
|
||||||
| TOAST { $$ = make_str("toast"); }
|
|
||||||
| TRIGGER { $$ = make_str("trigger"); }
|
|
||||||
| TRUNCATE { $$ = make_str("truncate"); }
|
|
||||||
| TRUSTED { $$ = make_str("trusted"); }
|
|
||||||
| UNENCRYPTED { $$ = make_str("unencrypted"); }
|
|
||||||
| UNLISTEN { $$ = make_str("unlisten"); }
|
|
||||||
| UNTIL { $$ = make_str("until"); }
|
|
||||||
| UPDATE { $$ = make_str("update"); }
|
|
||||||
| VALID { $$ = make_str("valid"); }
|
|
||||||
| VALUES { $$ = make_str("values"); }
|
|
||||||
| VARYING { $$ = make_str("varying"); }
|
|
||||||
| VERSION { $$ = make_str("version"); }
|
|
||||||
| VIEW { $$ = make_str("view"); }
|
|
||||||
| WITH { $$ = make_str("with"); }
|
|
||||||
| WITHOUT { $$ = make_str("without"); }
|
|
||||||
| WORK { $$ = make_str("work"); }
|
|
||||||
| ZONE { $$ = make_str("zone"); }
|
|
||||||
;
|
|
||||||
|
|
||||||
ECPGColId: ident { $$ = $1; }
|
/* Type/func identifier --- names that can be type and function names
|
||||||
| TYPE_P { $$ = make_str("type"); }
|
* (as well as ColIds --- ie, these are completely unreserved keywords).
|
||||||
| datetime { $$ = $1; }
|
*/
|
||||||
| TokenId { $$ = $1; }
|
TypeFuncId: ECPGTypeFuncId { $$ = $1; }
|
||||||
| NATIONAL { $$ = make_str("national"); }
|
| ECPGKeywords { $$ = $1; }
|
||||||
| NONE { $$ = make_str("none"); }
|
;
|
||||||
| PATH_P { $$ = make_str("path_p"); }
|
|
||||||
| ECPGKeywords { $$ = $1; }
|
|
||||||
;
|
|
||||||
|
|
||||||
ECPGColLabel: ECPGColId { $$ = $1; }
|
ECPGTypeFuncId: ident { $$ = $1; }
|
||||||
| ABORT_TRANS { $$ = make_str("abort"); }
|
| ABORT_TRANS { $$ = make_str("abort"); }
|
||||||
| ALL { $$ = make_str("all"); }
|
| ABSOLUTE { $$ = make_str("absolute"); }
|
||||||
| ANALYSE { $$ = make_str("analyse"); }
|
| ACCESS { $$ = make_str("access"); }
|
||||||
| ANALYZE { $$ = make_str("analyze"); }
|
| ACTION { $$ = make_str("action"); }
|
||||||
| ANY { $$ = make_str("any"); }
|
| ADD { $$ = make_str("add"); }
|
||||||
| ASC { $$ = make_str("asc"); }
|
| AFTER { $$ = make_str("after"); }
|
||||||
| BETWEEN { $$ = make_str("between"); }
|
| AGGREGATE { $$ = make_str("aggregate"); }
|
||||||
| BINARY { $$ = make_str("binary"); }
|
| ALTER { $$ = make_str("alter"); }
|
||||||
| BIT { $$ = make_str("bit"); }
|
| AT { $$ = make_str("at"); }
|
||||||
| BOTH { $$ = make_str("both"); }
|
| AUTHORIZATION { $$ = make_str("authorization"); }
|
||||||
| CASE { $$ = make_str("case"); }
|
| BACKWARD { $$ = make_str("backward"); }
|
||||||
| CAST { $$ = make_str("cast"); }
|
| BEFORE { $$ = make_str("before"); }
|
||||||
| CHARACTER { $$ = make_str("character"); }
|
| BEGIN_TRANS { $$ = make_str("begin"); }
|
||||||
| CHECK { $$ = make_str("check"); }
|
| BY { $$ = make_str("by"); }
|
||||||
| CLUSTER { $$ = make_str("cluster"); }
|
| CACHE { $$ = make_str("cache"); }
|
||||||
| COALESCE { $$ = make_str("coalesce"); }
|
| CASCADE { $$ = make_str("cascade"); }
|
||||||
| COLLATE { $$ = make_str("collate"); }
|
| CHAIN { $$ = make_str("chain"); }
|
||||||
| COLUMN { $$ = make_str("column"); }
|
| CHARACTERISTICS { $$ = make_str("characteristics"); }
|
||||||
| CONSTRAINT { $$ = make_str("constraint"); }
|
| CHECKPOINT { $$ = make_str("checkpoint"); }
|
||||||
| COPY { $$ = make_str("copy"); }
|
| CLOSE { $$ = make_str("close"); }
|
||||||
| CROSS { $$ = make_str("cross"); }
|
| CLUSTER { $$ = make_str("cluster"); }
|
||||||
| CURRENT_DATE { $$ = make_str("current_date"); }
|
| COMMENT { $$ = make_str("comment"); }
|
||||||
| CURRENT_TIME { $$ = make_str("current_time"); }
|
| COMMIT { $$ = make_str("commit"); }
|
||||||
| CURRENT_TIMESTAMP { $$ = make_str("current_timestamp"); }
|
| COMMITTED { $$ = make_str("committed"); }
|
||||||
| CURRENT_USER { $$ = make_str("current_user"); }
|
| CONSTRAINTS { $$ = make_str("constraints"); }
|
||||||
| DEC { $$ = make_str("dec"); }
|
| COPY { $$ = make_str("copy"); }
|
||||||
| DECIMAL { $$ = make_str("decimal"); }
|
| CREATE { $$ = make_str("create"); }
|
||||||
| DEFAULT { $$ = make_str("default"); }
|
| CREATEDB { $$ = make_str("createdb"); }
|
||||||
| DEFERRABLE { $$ = make_str("deferrable"); }
|
| CREATEUSER { $$ = make_str("createuser"); }
|
||||||
| DESC { $$ = make_str("desc"); }
|
| CURSOR { $$ = make_str("cursor"); }
|
||||||
| DISTINCT { $$ = make_str("distinct"); }
|
| CYCLE { $$ = make_str("cycle"); }
|
||||||
| DO { $$ = make_str("do"); }
|
| DATABASE { $$ = make_str("database"); }
|
||||||
| ELSE { $$ = make_str("else"); }
|
| DAY_P { $$ = make_str("day"); }
|
||||||
| END_TRANS { $$ = make_str("end"); }
|
| DECLARE { $$ = make_str("declare"); }
|
||||||
| EXCEPT { $$ = make_str("except"); }
|
| DEFERRED { $$ = make_str("deferred"); }
|
||||||
| EXISTS { $$ = make_str("exists"); }
|
| DELETE { $$ = make_str("delete"); }
|
||||||
| EXPLAIN { $$ = make_str("explain"); }
|
| DELIMITERS { $$ = make_str("delimiters"); }
|
||||||
| EXTRACT { $$ = make_str("extract"); }
|
| DOUBLE { $$ = make_str("double"); }
|
||||||
| FALSE_P { $$ = make_str("false"); }
|
| DROP { $$ = make_str("drop"); }
|
||||||
| FOR { $$ = make_str("for"); }
|
| EACH { $$ = make_str("each"); }
|
||||||
| FOREIGN { $$ = make_str("foreign"); }
|
| ENCODING { $$ = make_str("encoding"); }
|
||||||
| FREEZE { $$ = make_str("freeze"); }
|
| ENCRYPTED { $$ = make_str("encrypted"); }
|
||||||
| FROM { $$ = make_str("from"); }
|
| ESCAPE { $$ = make_str("escape"); }
|
||||||
| FULL { $$ = make_str("full"); }
|
| EXCLUSIVE { $$ = make_str("exclusive"); }
|
||||||
| GLOBAL { $$ = make_str("global"); }
|
| EXECUTE { $$ = make_str("execute"); }
|
||||||
| GROUP { $$ = make_str("group"); }
|
| EXPLAIN { $$ = make_str("explain"); }
|
||||||
| HAVING { $$ = make_str("having"); }
|
| FETCH { $$ = make_str("fetch"); }
|
||||||
| ILIKE { $$ = make_str("ilike"); }
|
| FORCE { $$ = make_str("force"); }
|
||||||
| IN { $$ = make_str("in"); }
|
| FORWARD { $$ = make_str("forward"); }
|
||||||
| INITIALLY { $$ = make_str("initially"); }
|
| FUNCTION { $$ = make_str("function"); }
|
||||||
| INNER_P { $$ = make_str("inner"); }
|
| GLOBAL { $$ = make_str("global"); }
|
||||||
| INOUT { $$ = make_str("inout"); }
|
| GRANT { $$ = make_str("grant"); }
|
||||||
| INTERSECT { $$ = make_str("intersect"); }
|
| HANDLER { $$ = make_str("handler"); }
|
||||||
| INTERVAL { $$ = make_str("interval"); }
|
| HOUR_P { $$ = make_str("hour"); }
|
||||||
| INTO { $$ = make_str("into"); }
|
| IMMEDIATE { $$ = make_str("immediate"); }
|
||||||
| IS { $$ = make_str("is"); }
|
| INCREMENT { $$ = make_str("increment"); }
|
||||||
| ISNULL { $$ = make_str("isnull"); }
|
| INDEX { $$ = make_str("index"); }
|
||||||
| JOIN { $$ = make_str("join"); }
|
| INHERITS { $$ = make_str("inherits"); }
|
||||||
| LEADING { $$ = make_str("leading"); }
|
| INOUT { $$ = make_str("inout"); }
|
||||||
| LEFT { $$ = make_str("left"); }
|
| INSENSITIVE { $$ = make_str("insensitive"); }
|
||||||
| LIKE { $$ = make_str("like"); }
|
| INSERT { $$ = make_str("insert"); }
|
||||||
| LIMIT { $$ = make_str("limit"); }
|
| INSTEAD { $$ = make_str("instead"); }
|
||||||
| LISTEN { $$ = make_str("listen"); }
|
| ISOLATION { $$ = make_str("isolation"); }
|
||||||
| LOAD { $$ = make_str("load"); }
|
| KEY { $$ = make_str("key"); }
|
||||||
| LOCK_P { $$ = make_str("lock"); }
|
| LANGUAGE { $$ = make_str("language"); }
|
||||||
| MOVE { $$ = make_str("move"); }
|
| LANCOMPILER { $$ = make_str("lancompiler"); }
|
||||||
| NATURAL { $$ = make_str("natural"); }
|
| LEVEL { $$ = make_str("level"); }
|
||||||
| NCHAR { $$ = make_str("nchar"); }
|
| LISTEN { $$ = make_str("listen"); }
|
||||||
| NEW { $$ = make_str("new"); }
|
| LOAD { $$ = make_str("load"); }
|
||||||
| NOT { $$ = make_str("not"); }
|
| LOCAL { $$ = make_str("local"); }
|
||||||
| NOTNULL { $$ = make_str("notnull"); }
|
| LOCATION { $$ = make_str("location"); }
|
||||||
| NULLIF { $$ = make_str("nullif"); }
|
| LOCK_P { $$ = make_str("lock"); }
|
||||||
| NULL_P { $$ = make_str("null"); }
|
| MATCH { $$ = make_str("match"); }
|
||||||
| NUMERIC { $$ = make_str("numeric"); }
|
| MAXVALUE { $$ = make_str("maxvalue"); }
|
||||||
| OFF { $$ = make_str("off"); }
|
| MINUTE_P { $$ = make_str("minute"); }
|
||||||
| OFFSET { $$ = make_str("offset"); }
|
| MINVALUE { $$ = make_str("minvalue"); }
|
||||||
| OLD { $$ = make_str("old"); }
|
| MODE { $$ = make_str("mode"); }
|
||||||
| ON { $$ = make_str("on"); }
|
| MONTH_P { $$ = make_str("month"); }
|
||||||
| ONLY { $$ = make_str("only"); }
|
| MOVE { $$ = make_str("move"); }
|
||||||
| OR { $$ = make_str("or"); }
|
| NAMES { $$ = make_str("names"); }
|
||||||
| ORDER { $$ = make_str("order"); }
|
| NATIONAL { $$ = make_str("national"); }
|
||||||
| OUT { $$ = make_str("out"); }
|
| NEXT { $$ = make_str("next"); }
|
||||||
| OUTER_P { $$ = make_str("outer"); }
|
| NO { $$ = make_str("no"); }
|
||||||
| OVERLAPS { $$ = make_str("overlaps"); }
|
| NOCREATEDB { $$ = make_str("nocreatedb"); }
|
||||||
| POSITION { $$ = make_str("position"); }
|
| NOCREATEUSER { $$ = make_str("nocreateuser"); }
|
||||||
| PRECISION { $$ = make_str("precision"); }
|
| NOTHING { $$ = make_str("nothing"); }
|
||||||
| PRIMARY { $$ = make_str("primary"); }
|
| NOTIFY { $$ = make_str("notify"); }
|
||||||
| PUBLIC { $$ = make_str("public"); }
|
| OF { $$ = make_str("of"); }
|
||||||
| REFERENCES { $$ = make_str("references"); }
|
| OIDS { $$ = make_str("oids"); }
|
||||||
| RESET { $$ = make_str("reset"); }
|
| OPERATOR { $$ = make_str("operator"); }
|
||||||
| RIGHT { $$ = make_str("right"); }
|
| OPTION { $$ = make_str("option"); }
|
||||||
| SELECT { $$ = make_str("select"); }
|
| OUT { $$ = make_str("out"); }
|
||||||
| SESSION_USER { $$ = make_str("session_user"); }
|
| OWNER { $$ = make_str("owner"); }
|
||||||
| SETOF { $$ = make_str("setof"); }
|
| PARTIAL { $$ = make_str("partial"); }
|
||||||
| SHOW { $$ = make_str("show"); }
|
| PASSWORD { $$ = make_str("password"); }
|
||||||
| SUBSTRING { $$ = make_str("substring"); }
|
| PATH_P { $$ = make_str("path"); }
|
||||||
| TABLE { $$ = make_str("table"); }
|
| PENDANT { $$ = make_str("pendant"); }
|
||||||
| THEN { $$ = make_str("then"); }
|
| PRECISION { $$ = make_str("precision"); }
|
||||||
| TIME { $$ = make_str("time"); }
|
| PRIOR { $$ = make_str("prior"); }
|
||||||
| TIMESTAMP { $$ = make_str("timestamp"); }
|
| PRIVILEGES { $$ = make_str("privileges"); }
|
||||||
| TO { $$ = make_str("to"); }
|
| PROCEDURAL { $$ = make_str("procedural"); }
|
||||||
| TRANSACTION { $$ = make_str("transaction"); }
|
| PROCEDURE { $$ = make_str("procedure"); }
|
||||||
| TRIM { $$ = make_str("trim"); }
|
| READ { $$ = make_str("read"); }
|
||||||
| TRUE_P { $$ = make_str("true"); }
|
| REINDEX { $$ = make_str("reindex"); }
|
||||||
| UNIQUE { $$ = make_str("unique"); }
|
| RELATIVE { $$ = make_str("relative"); }
|
||||||
| UNKNOWN { $$ = make_str("unknown"); }
|
| RENAME { $$ = make_str("rename"); }
|
||||||
| USER { $$ = make_str("user"); }
|
| REPLACE { $$ = make_str("replace"); }
|
||||||
| USING { $$ = make_str("using"); }
|
| RESET { $$ = make_str("reset"); }
|
||||||
| VACUUM { $$ = make_str("vacuum"); }
|
| RESTRICT { $$ = make_str("restrict"); }
|
||||||
| VERBOSE { $$ = make_str("verbose"); }
|
| RETURNS { $$ = make_str("returns"); }
|
||||||
| WHEN { $$ = make_str("when"); }
|
| REVOKE { $$ = make_str("revoke"); }
|
||||||
| WHERE { $$ = make_str("where"); }
|
| ROLLBACK { $$ = make_str("rollback"); }
|
||||||
|
| ROW { $$ = make_str("row"); }
|
||||||
|
| RULE { $$ = make_str("rule"); }
|
||||||
|
| SCHEMA { $$ = make_str("schema"); }
|
||||||
|
| SCROLL { $$ = make_str("scroll"); }
|
||||||
|
| SECOND_P { $$ = make_str("second"); }
|
||||||
|
| SESSION { $$ = make_str("session"); }
|
||||||
|
| SEQUENCE { $$ = make_str("sequence"); }
|
||||||
|
| SERIALIZABLE { $$ = make_str("serializable"); }
|
||||||
|
| SET { $$ = make_str("set"); }
|
||||||
|
| SHARE { $$ = make_str("share"); }
|
||||||
|
| SHOW { $$ = make_str("show"); }
|
||||||
|
| START { $$ = make_str("start"); }
|
||||||
|
| STATEMENT { $$ = make_str("statement"); }
|
||||||
|
| STATISTICS { $$ = make_str("statistics"); }
|
||||||
|
| STDIN { $$ = make_str("stdin"); }
|
||||||
|
| STDOUT { $$ = make_str("stdout"); }
|
||||||
|
| SYSID { $$ = make_str("sysid"); }
|
||||||
|
| TEMP { $$ = make_str("temp"); }
|
||||||
|
| TEMPLATE { $$ = make_str("template"); }
|
||||||
|
| TEMPORARY { $$ = make_str("temporary"); }
|
||||||
|
| TOAST { $$ = make_str("toast"); }
|
||||||
|
| TRANSACTION { $$ = make_str("transaction"); }
|
||||||
|
| TRIGGER { $$ = make_str("trigger"); }
|
||||||
|
| TRUNCATE { $$ = make_str("truncate"); }
|
||||||
|
| TRUSTED { $$ = make_str("trusted"); }
|
||||||
|
| TYPE_P { $$ = make_str("type"); }
|
||||||
|
| UNENCRYPTED { $$ = make_str("unencrypted"); }
|
||||||
|
| UNKNOWN { $$ = make_str("unknown"); }
|
||||||
|
| UNLISTEN { $$ = make_str("unlisten"); }
|
||||||
|
| UNTIL { $$ = make_str("until"); }
|
||||||
|
| UPDATE { $$ = make_str("update"); }
|
||||||
|
| VACUUM { $$ = make_str("vacuum"); }
|
||||||
|
| VALID { $$ = make_str("valid"); }
|
||||||
|
| VALUES { $$ = make_str("values"); }
|
||||||
|
| VARYING { $$ = make_str("varying"); }
|
||||||
|
| VERSION { $$ = make_str("version"); }
|
||||||
|
| VIEW { $$ = make_str("view"); }
|
||||||
|
| WITH { $$ = make_str("with"); }
|
||||||
|
| WITHOUT { $$ = make_str("without"); }
|
||||||
|
| WORK { $$ = make_str("work"); }
|
||||||
|
| YEAR_P { $$ = make_str("year"); }
|
||||||
|
| ZONE { $$ = make_str("zone"); }
|
||||||
|
;
|
||||||
|
|
||||||
|
/* Column identifier --- names that can be column, table, etc names.
|
||||||
|
*
|
||||||
|
* This contains the TypeFuncId list plus those keywords that conflict
|
||||||
|
* only with typename productions, not with other uses. Note that
|
||||||
|
* most of these keywords will in fact be recognized as type names too;
|
||||||
|
* they just have to have special productions for the purpose.
|
||||||
|
*
|
||||||
|
* Most of these cannot be in TypeFuncId (ie, are not also usable as function
|
||||||
|
* names) because they can be followed by '(' in typename productions, which
|
||||||
|
* looks too much like a function call for a LALR(1) parser.
|
||||||
|
*/
|
||||||
|
ColId: ECPGColId { $$ = $1; }
|
||||||
|
| CHAR { $$ = make_str("char"); }
|
||||||
|
;
|
||||||
|
|
||||||
|
ECPGColId: TypeFuncId { $$ = $1; }
|
||||||
|
| BIT { $$ = make_str("bit"); }
|
||||||
|
/* CHAR must be excluded from ECPGColLabel because of conflict with UNSIGNED
|
||||||
|
| CHAR { $$ = make_str("char"); }
|
||||||
|
*/
|
||||||
|
| CHARACTER { $$ = make_str("character"); }
|
||||||
|
| DEC { $$ = make_str("dec"); }
|
||||||
|
| DECIMAL { $$ = make_str("decimal"); }
|
||||||
|
| FLOAT { $$ = make_str("float"); }
|
||||||
|
| INTERVAL { $$ = make_str("interval"); }
|
||||||
|
| NCHAR { $$ = make_str("nchar"); }
|
||||||
|
| NONE { $$ = make_str("none"); }
|
||||||
|
| NUMERIC { $$ = make_str("numeric"); }
|
||||||
|
| SETOF { $$ = make_str("setof"); }
|
||||||
|
| TIME { $$ = make_str("time"); }
|
||||||
|
| TIMESTAMP { $$ = make_str("timestamp"); }
|
||||||
|
| VARCHAR { $$ = make_str("varchar"); }
|
||||||
|
;
|
||||||
|
|
||||||
|
/* Column label --- allowed labels in "AS" clauses.
|
||||||
|
*
|
||||||
|
* Keywords appear here if they could not be distinguished from variable,
|
||||||
|
* type, or function names in some contexts.
|
||||||
|
* When adding a ColLabel, consider whether it can be added to func_name.
|
||||||
|
*/
|
||||||
|
ColLabel: ECPGColLabel { $$ = $1; }
|
||||||
|
| CHAR { $$ = make_str("char"); }
|
||||||
|
| UNION { $$ = make_str("union"); }
|
||||||
|
;
|
||||||
|
|
||||||
|
ECPGColLabel: ECPGColId { $$ = $1; }
|
||||||
|
| ALL { $$ = make_str("all"); }
|
||||||
|
| ANALYSE { $$ = make_str("analyse"); } /* British */
|
||||||
|
| ANALYZE { $$ = make_str("analyze"); }
|
||||||
|
| AND { $$ = make_str("and"); }
|
||||||
|
| ANY { $$ = make_str("any"); }
|
||||||
|
| ASC { $$ = make_str("asc"); }
|
||||||
|
| BETWEEN { $$ = make_str("between"); }
|
||||||
|
| BINARY { $$ = make_str("binary"); }
|
||||||
|
| BOTH { $$ = make_str("both"); }
|
||||||
|
| CASE { $$ = make_str("case"); }
|
||||||
|
| CAST { $$ = make_str("cast"); }
|
||||||
|
| CHECK { $$ = make_str("check"); }
|
||||||
|
| COALESCE { $$ = make_str("coalesce"); }
|
||||||
|
| COLLATE { $$ = make_str("collate"); }
|
||||||
|
| COLUMN { $$ = make_str("column"); }
|
||||||
|
| CONSTRAINT { $$ = make_str("constraint"); }
|
||||||
|
| CROSS { $$ = make_str("cross"); }
|
||||||
|
| CURRENT_DATE { $$ = make_str("current_date"); }
|
||||||
|
| CURRENT_TIME { $$ = make_str("current_time"); }
|
||||||
|
| CURRENT_TIMESTAMP { $$ = make_str("current_timestamp"); }
|
||||||
|
| CURRENT_USER { $$ = make_str("current_user"); }
|
||||||
|
| DEFAULT { $$ = make_str("default"); }
|
||||||
|
| DEFERRABLE { $$ = make_str("deferrable"); }
|
||||||
|
| DESC { $$ = make_str("desc"); }
|
||||||
|
| DISTINCT { $$ = make_str("distinct"); }
|
||||||
|
| DO { $$ = make_str("do"); }
|
||||||
|
| ELSE { $$ = make_str("else"); }
|
||||||
|
| END_TRANS { $$ = make_str("end"); }
|
||||||
|
| EXCEPT { $$ = make_str("except"); }
|
||||||
|
| EXISTS { $$ = make_str("exists"); }
|
||||||
|
| EXTRACT { $$ = make_str("extract"); }
|
||||||
|
| FALSE_P { $$ = make_str("false"); }
|
||||||
|
| FOR { $$ = make_str("for"); }
|
||||||
|
| FOREIGN { $$ = make_str("foreign"); }
|
||||||
|
| FREEZE { $$ = make_str("freeze"); }
|
||||||
|
| FROM { $$ = make_str("from"); }
|
||||||
|
| FULL { $$ = make_str("full"); }
|
||||||
|
| GROUP { $$ = make_str("group"); }
|
||||||
|
| HAVING { $$ = make_str("having"); }
|
||||||
|
| ILIKE { $$ = make_str("ilike"); }
|
||||||
|
| IN { $$ = make_str("in"); }
|
||||||
|
| INITIALLY { $$ = make_str("initially"); }
|
||||||
|
| INNER_P { $$ = make_str("inner"); }
|
||||||
|
| INTERSECT { $$ = make_str("intersect"); }
|
||||||
|
| INTO { $$ = make_str("into"); }
|
||||||
|
| IS { $$ = make_str("is"); }
|
||||||
|
| ISNULL { $$ = make_str("isnull"); }
|
||||||
|
| JOIN { $$ = make_str("join"); }
|
||||||
|
| LEADING { $$ = make_str("leading"); }
|
||||||
|
| LEFT { $$ = make_str("left"); }
|
||||||
|
| LIKE { $$ = make_str("like"); }
|
||||||
|
| LIMIT { $$ = make_str("limit"); }
|
||||||
|
| NATURAL { $$ = make_str("natural"); }
|
||||||
|
| NEW { $$ = make_str("new"); }
|
||||||
|
| NOT { $$ = make_str("not"); }
|
||||||
|
| NOTNULL { $$ = make_str("notnull"); }
|
||||||
|
| NULLIF { $$ = make_str("nullif"); }
|
||||||
|
| NULL_P { $$ = make_str("null"); }
|
||||||
|
| OFF { $$ = make_str("off"); }
|
||||||
|
| OFFSET { $$ = make_str("offset"); }
|
||||||
|
| OLD { $$ = make_str("old"); }
|
||||||
|
| ON { $$ = make_str("on"); }
|
||||||
|
| ONLY { $$ = make_str("only"); }
|
||||||
|
| OR { $$ = make_str("or"); }
|
||||||
|
| ORDER { $$ = make_str("order"); }
|
||||||
|
| OUTER_P { $$ = make_str("outer"); }
|
||||||
|
| OVERLAPS { $$ = make_str("overlaps"); }
|
||||||
|
| POSITION { $$ = make_str("position"); }
|
||||||
|
| PRIMARY { $$ = make_str("primary"); }
|
||||||
|
| PUBLIC { $$ = make_str("public"); }
|
||||||
|
| REFERENCES { $$ = make_str("references"); }
|
||||||
|
| RIGHT { $$ = make_str("right"); }
|
||||||
|
| SELECT { $$ = make_str("select"); }
|
||||||
|
| SESSION_USER { $$ = make_str("session_user"); }
|
||||||
|
| SOME { $$ = make_str("some"); }
|
||||||
|
| SUBSTRING { $$ = make_str("substring"); }
|
||||||
|
| TABLE { $$ = make_str("table"); }
|
||||||
|
| THEN { $$ = make_str("then"); }
|
||||||
|
| TO { $$ = make_str("to"); }
|
||||||
|
| TRAILING { $$ = make_str("trailing"); }
|
||||||
|
| TRIM { $$ = make_str("trim"); }
|
||||||
|
| TRUE_P { $$ = make_str("true"); }
|
||||||
|
/* UNION must be excluded from ECPGColLabel because of conflict with s_union
|
||||||
|
| UNION { $$ = make_str("union"); }
|
||||||
|
*/
|
||||||
|
| UNIQUE { $$ = make_str("unique"); }
|
||||||
|
| USER { $$ = make_str("user"); }
|
||||||
|
| USING { $$ = make_str("using"); }
|
||||||
|
| VERBOSE { $$ = make_str("verbose"); }
|
||||||
|
| WHEN { $$ = make_str("when"); }
|
||||||
|
| WHERE { $$ = make_str("where"); }
|
||||||
|
;
|
||||||
|
|
||||||
|
/* Function identifier --- names that can be function names.
|
||||||
|
*
|
||||||
|
* This contains the TypeFuncId list plus some ColLabel keywords
|
||||||
|
* that are used as operators in expressions; in general such keywords
|
||||||
|
* can't be ColId because they would be ambiguous with variable names,
|
||||||
|
* but they are unambiguous as function identifiers.
|
||||||
|
*
|
||||||
|
* Do not include POSITION, SUBSTRING, etc here since they have explicit
|
||||||
|
* productions in a_expr to support the goofy SQL9x argument syntax.
|
||||||
|
* - thomas 2000-11-28
|
||||||
|
*/
|
||||||
|
func_name: TypeFuncId { $$ = $1; }
|
||||||
|
| BETWEEN { $$ = make_str("between"); }
|
||||||
|
| BINARY { $$ = make_str("binary"); }
|
||||||
|
| CROSS { $$ = make_str("cross"); }
|
||||||
|
| FREEZE { $$ = make_str("freeze"); }
|
||||||
|
| FULL { $$ = make_str("full"); }
|
||||||
|
| ILIKE { $$ = make_str("ilike"); }
|
||||||
|
| IN { $$ = make_str("in"); }
|
||||||
|
| INNER_P { $$ = make_str("inner"); }
|
||||||
|
| IS { $$ = make_str("is"); }
|
||||||
|
| ISNULL { $$ = make_str("isnull"); }
|
||||||
|
| JOIN { $$ = make_str("join"); }
|
||||||
|
| LEFT { $$ = make_str("left"); }
|
||||||
|
| LIKE { $$ = make_str("like"); }
|
||||||
|
| NATURAL { $$ = make_str("natural"); }
|
||||||
|
| NOTNULL { $$ = make_str("notnull"); }
|
||||||
|
| OUTER_P { $$ = make_str("outer"); }
|
||||||
|
| OVERLAPS { $$ = make_str("overlaps"); }
|
||||||
|
| PUBLIC { $$ = make_str("public"); }
|
||||||
|
| RIGHT { $$ = make_str("right"); }
|
||||||
|
| VERBOSE { $$ = make_str("verbose"); }
|
||||||
;
|
;
|
||||||
|
|
||||||
into_list : coutputvariable | into_list ',' coutputvariable;
|
into_list : coutputvariable | into_list ',' coutputvariable;
|
||||||
|
Reference in New Issue
Block a user