Commit a3ec44a5 authored by Michael Meskes's avatar Michael Meskes

Commit old versions into main branch again.

Michael
parent 97862234
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.51 2002/06/30 09:34:13 meskes Exp $ * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.52 2002/07/01 06:56:10 meskes Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -44,7 +44,6 @@ static ScanKeyword ScanKeywords[] = { ...@@ -44,7 +44,6 @@ static ScanKeyword ScanKeywords[] = {
{"as", AS}, {"as", AS},
{"asc", ASC}, {"asc", ASC},
{"assertion", ASSERTION}, {"assertion", ASSERTION},
{"assignment", ASSIGNMENT},
{"at", AT}, {"at", AT},
{"authorization", AUTHORIZATION}, {"authorization", AUTHORIZATION},
{"backward", BACKWARD}, {"backward", BACKWARD},
...@@ -99,7 +98,6 @@ static ScanKeyword ScanKeywords[] = { ...@@ -99,7 +98,6 @@ static ScanKeyword ScanKeywords[] = {
{"deferred", DEFERRED}, {"deferred", DEFERRED},
{"definer", DEFINER}, {"definer", DEFINER},
{"delete", DELETE_P}, {"delete", DELETE_P},
{"delimiter", DELIMITER},
{"delimiters", DELIMITERS}, {"delimiters", DELIMITERS},
{"desc", DESC}, {"desc", DESC},
{"distinct", DISTINCT}, {"distinct", DISTINCT},
...@@ -173,8 +171,6 @@ static ScanKeyword ScanKeywords[] = { ...@@ -173,8 +171,6 @@ static ScanKeyword ScanKeywords[] = {
{"listen", LISTEN}, {"listen", LISTEN},
{"load", LOAD}, {"load", LOAD},
{"local", LOCAL}, {"local", LOCAL},
{"localtime", LOCALTIME},
{"localtimestamp", LOCALTIMESTAMP},
{"location", LOCATION}, {"location", LOCATION},
{"lock", LOCK_P}, {"lock", LOCK_P},
{"match", MATCH}, {"match", MATCH},
...@@ -215,13 +211,11 @@ static ScanKeyword ScanKeywords[] = { ...@@ -215,13 +211,11 @@ static ScanKeyword ScanKeywords[] = {
{"out", OUT_P}, {"out", OUT_P},
{"outer", OUTER_P}, {"outer", OUTER_P},
{"overlaps", OVERLAPS}, {"overlaps", OVERLAPS},
{"overlay", OVERLAY},
{"owner", OWNER}, {"owner", OWNER},
{"partial", PARTIAL}, {"partial", PARTIAL},
{"password", PASSWORD}, {"password", PASSWORD},
{"path", PATH_P}, {"path", PATH_P},
{"pendant", PENDANT}, {"pendant", PENDANT},
{"placing", PLACING},
{"position", POSITION}, {"position", POSITION},
{"precision", PRECISION}, {"precision", PRECISION},
{"primary", PRIMARY}, {"primary", PRIMARY},
...@@ -257,8 +251,6 @@ static ScanKeyword ScanKeywords[] = { ...@@ -257,8 +251,6 @@ static ScanKeyword ScanKeywords[] = {
{"setof", SETOF}, {"setof", SETOF},
{"share", SHARE}, {"share", SHARE},
{"show", SHOW}, {"show", SHOW},
{"similar", SIMILAR},
{"simple", SIMPLE},
{"smallint", SMALLINT}, {"smallint", SMALLINT},
{"some", SOME}, {"some", SOME},
{"stable", STABLE}, {"stable", STABLE},
...@@ -300,7 +292,6 @@ static ScanKeyword ScanKeywords[] = { ...@@ -300,7 +292,6 @@ static ScanKeyword ScanKeywords[] = {
{"using", USING}, {"using", USING},
{"vacuum", VACUUM}, {"vacuum", VACUUM},
{"valid", VALID}, {"valid", VALID},
{"validator", VALIDATOR},
{"values", VALUES}, {"values", VALUES},
{"varchar", VARCHAR}, {"varchar", VARCHAR},
{"varying", VARYING}, {"varying", VARYING},
...@@ -313,7 +304,6 @@ static ScanKeyword ScanKeywords[] = { ...@@ -313,7 +304,6 @@ static ScanKeyword ScanKeywords[] = {
{"with", WITH}, {"with", WITH},
{"without", WITHOUT}, {"without", WITHOUT},
{"work", WORK}, {"work", WORK},
{"write", WRITE},
{"year", YEAR_P}, {"year", YEAR_P},
{"zone", ZONE}, {"zone", ZONE},
}; };
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.95 2002/06/30 09:34:13 meskes Exp $ * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.96 2002/07/01 06:56:10 meskes Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -89,14 +89,14 @@ static struct _if_value ...@@ -89,14 +89,14 @@ static struct _if_value
* We use exclusive states for quoted strings, extended comments, * We use exclusive states for quoted strings, extended comments,
* and to eliminate parsing troubles for numeric strings. * and to eliminate parsing troubles for numeric strings.
* Exclusive states: * Exclusive states:
* <xb> bit string literal * <xbit> bit string literal
* <xc> extended C-style comments - thomas 1997-07-12 * <xc> extended C-style comments - thomas 1997-07-12
* <xd> delimited identifiers (double-quoted identifiers) - thomas 1997-10-27 * <xd> delimited identifiers (double-quoted identifiers) - thomas 1997-10-27
* <xh> hexadecimal numeric string - thomas 1997-11-16 * <xh> hexadecimal numeric string - thomas 1997-11-16
* <xq> quoted strings - thomas 1997-07-30 * <xq> quoted strings - thomas 1997-07-30
*/ */
%x xb %x xbit
%x xc %x xc
%x xd %x xd
%x xdc %x xdc
...@@ -108,10 +108,10 @@ static struct _if_value ...@@ -108,10 +108,10 @@ static struct _if_value
/* Bit string /* Bit string
*/ */
xbstart [bB]{quote} xbitstart [bB]{quote}
xbstop {quote} xbitstop {quote}
xbinside [^']* xbitinside [^']*
xbcat {quote}{whitespace_with_newline}{quote} xbitcat {quote}{whitespace_with_newline}{quote}
/* Hexadecimal number /* Hexadecimal number
*/ */
...@@ -318,13 +318,13 @@ cppline {space}*#(.*\\{space})*.* ...@@ -318,13 +318,13 @@ cppline {space}*#(.*\\{space})*.*
<xc><<EOF>> { mmerror(PARSE_ERROR, ET_ERROR, "Unterminated /* comment"); } <xc><<EOF>> { mmerror(PARSE_ERROR, ET_ERROR, "Unterminated /* comment"); }
<SQL>{xbstart} { <SQL>{xbitstart} {
token_start = yytext; token_start = yytext;
BEGIN(xb); BEGIN(xbit);
startlit(); startlit();
addlitchar('b'); addlitchar('b');
} }
<xb>{xbstop} { <xbit>{xbitstop} {
BEGIN(SQL); BEGIN(SQL);
if (literalbuf[strspn(literalbuf, "01") + 1] != '\0') if (literalbuf[strspn(literalbuf, "01") + 1] != '\0')
mmerror(PARSE_ERROR, ET_ERROR, "invalid bit string input."); mmerror(PARSE_ERROR, ET_ERROR, "invalid bit string input.");
...@@ -333,10 +333,10 @@ cppline {space}*#(.*\\{space})*.* ...@@ -333,10 +333,10 @@ cppline {space}*#(.*\\{space})*.*
} }
<xh>{xhinside} | <xh>{xhinside} |
<xb>{xbinside} { addlit(yytext, yyleng); } <xbit>{xbitinside} { addlit(yytext, yyleng); }
<xh>{xhcat} | <xh>{xhcat} |
<xb>{xbcat} { /* ignore */ } <xbit>{xbitcat} { /* ignore */ }
<xb><<EOF>> { mmerror(PARSE_ERROR, ET_ERROR, "Unterminated bit string"); } <xbit><<EOF>> { mmerror(PARSE_ERROR, ET_ERROR, "Unterminated bit string"); }
<SQL>{xhstart} { <SQL>{xhstart} {
token_start = yytext; token_start = yytext;
...@@ -378,7 +378,7 @@ cppline {space}*#(.*\\{space})*.* ...@@ -378,7 +378,7 @@ cppline {space}*#(.*\\{space})*.*
<xq>{xqdouble} { addlitchar('\''); } <xq>{xqdouble} { addlitchar('\''); }
<xq>{xqinside} { addlit(yytext, yyleng); } <xq>{xqinside} { addlit(yytext, yyleng); }
<xq>{xqescape} { addlit(yytext, yyleng); } <xq>{xqescape} { addlit(yytext, yyleng); }
<xq>{xqoctesc} { addlit(yytext, yyleng); } /* addlitchar does not work here since character must remain octal */ <xq>{xqoctesc} { addlit(yytext, yyleng); }
<xq>{xqcat} { /* ignore */ } <xq>{xqcat} { /* ignore */ }
<xq><<EOF>> { mmerror(PARSE_ERROR, ET_ERROR, "Unterminated quoted string"); } <xq><<EOF>> { mmerror(PARSE_ERROR, ET_ERROR, "Unterminated quoted string"); }
......
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.191 2002/06/30 09:34:14 meskes Exp $ */ /* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.192 2002/07/01 06:56:10 meskes Exp $ */
/* Copyright comment */ /* Copyright comment */
%{ %{
...@@ -179,7 +179,7 @@ make_name(void) ...@@ -179,7 +179,7 @@ make_name(void)
/* ordinary key words in alphabetical order */ /* ordinary key words in alphabetical order */
%token <keyword> ABORT_TRANS, ABSOLUTE, ACCESS, ACTION, ADD, AFTER, %token <keyword> ABORT_TRANS, ABSOLUTE, ACCESS, ACTION, ADD, AFTER,
AGGREGATE, ALL, ALTER, ANALYSE, ANALYZE, AND, ANY, AS, ASC, ASSERTION, AGGREGATE, ALL, ALTER, ANALYSE, ANALYZE, AND, ANY, AS, ASC, ASSERTION,
ASSIGNMENT, AT, AUTHORIZATION, AT, AUTHORIZATION,
BACKWARD, BEFORE, BEGIN_TRANS, BETWEEN, BIGINT, BINARY, BIT, BOTH, BACKWARD, BEFORE, BEGIN_TRANS, BETWEEN, BIGINT, BINARY, BIT, BOTH,
BOOLEAN, BY, BOOLEAN, BY,
...@@ -191,14 +191,14 @@ make_name(void) ...@@ -191,14 +191,14 @@ make_name(void)
CURRENT_TIMESTAMP, CURRENT_USER, CURSOR, CYCLE, CURRENT_TIMESTAMP, CURRENT_USER, CURSOR, CYCLE,
DATABASE, DAY_P, DEC, DECIMAL, DECLARE, DEFAULT, DEFERRABLE, DEFERRED, DATABASE, DAY_P, DEC, DECIMAL, DECLARE, DEFAULT, DEFERRABLE, DEFERRED,
DEFINER, DELETE_P, DELIMITER, DELIMITERS, DESC, DISTINCT, DO, DOMAIN_P, DOUBLE, DROP, DEFINER, DELETE_P, DELIMITERS, DESC, DISTINCT, DO, DOMAIN_P, DOUBLE, DROP,
EACH, ELSE, ENCODING, ENCRYPTED, END_TRANS, ESCAPE, EXCEPT, EXCLUSIVE, EACH, ELSE, ENCODING, ENCRYPTED, END_TRANS, ESCAPE, EXCEPT, EXCLUSIVE,
EXECUTE, EXISTS, EXPLAIN, EXTERNAL, EXTRACT, EXECUTE, EXISTS, EXPLAIN, EXTERNAL, EXTRACT,
FALSE_P, FETCH, FLOAT_P, FOR, FORCE, FOREIGN, FORWARD, FREEZE, FROM, FALSE_P, FETCH, FLOAT_P, FOR, FORCE, FOREIGN, FORWARD, FREEZE, FROM,
FULL, FUNCTION, FULL, FUNCTION,
GET, GLOBAL, GRANT, GROUP_P, GLOBAL, GRANT, GROUP_P,
HANDLER, HAVING, HOUR_P, HANDLER, HAVING, HOUR_P,
ILIKE, IMMEDIATE, IMMUTABLE, IMPLICIT, IN_P, INCREMENT, INDEX, INHERITS, ILIKE, IMMEDIATE, IMMUTABLE, IMPLICIT, IN_P, INCREMENT, INDEX, INHERITS,
...@@ -209,7 +209,7 @@ make_name(void) ...@@ -209,7 +209,7 @@ make_name(void)
KEY, KEY,
LANCOMPILER, LANGUAGE, LEADING, LEFT, LEVEL, LIKE, LIMIT, LISTEN, LANCOMPILER, LANGUAGE, LEADING, LEFT, LEVEL, LIKE, LIMIT, LISTEN,
LOAD, LOCAL, LOCALTIME, LOCALTIMESTAMP, LOCATION, LOCK_P, LOAD, LOCAL, LOCATION, LOCK_P,
MATCH, MAXVALUE, MINUTE_P, MINVALUE, MODE, MONTH_P, MOVE, MATCH, MAXVALUE, MINUTE_P, MINVALUE, MODE, MONTH_P, MOVE,
...@@ -218,17 +218,16 @@ make_name(void) ...@@ -218,17 +218,16 @@ make_name(void)
NUMERIC, NUMERIC,
OF, OFF, OFFSET, OIDS, OLD, ON, ONLY, OPERATOR, OPTION, OR, ORDER, OF, OFF, OFFSET, OIDS, OLD, ON, ONLY, OPERATOR, OPTION, OR, ORDER,
OUT_P, OUTER_P, OVERLAPS, OVERLAY, OWNER, OUT_P, OUTER_P, OVERLAPS, OWNER,
PARTIAL, PASSWORD, PATH_P, PENDANT, PLACING, POSITION, PRECISION, PRIMARY, PARTIAL, PASSWORD, PATH_P, PENDANT, POSITION, PRECISION, PRIMARY,
PRIOR, PRIVILEGES, PROCEDURE, PROCEDURAL, PRIOR, PRIVILEGES, PROCEDURE, PROCEDURAL,
READ, REAL, REFERENCES, REINDEX, RELATIVE, RENAME, REPLACE, RESET, READ, REAL, REFERENCES, REINDEX, RELATIVE, RENAME, REPLACE, RESET,
RESTRICT, RETURNS, REVOKE, RIGHT, ROLLBACK, ROW, RULE, RESTRICT, RETURNS, REVOKE, RIGHT, ROLLBACK, ROW, RULE,
SCHEMA, SCROLL, SECOND_P, SECURITY, SELECT, SEQUENCE, SERIALIZABLE, SCHEMA, SCROLL, SECOND_P, SECURITY, SELECT, SEQUENCE, SERIALIZABLE,
SESSION, SESSION_USER, SET, SETOF, SHARE, SHOW, SIMILAR, SIMPLE, SESSION, SESSION_USER, SET, SETOF, SHARE, SHOW, SMALLINT, SOME,
SMALLINT, SOME,
STABLE, START, STATEMENT, STATISTICS, STDIN, STDOUT, STORAGE, STRICT, STABLE, START, STATEMENT, STATISTICS, STDIN, STDOUT, STORAGE, STRICT,
SUBSTRING, SYSID, SUBSTRING, SYSID,
...@@ -237,8 +236,8 @@ make_name(void) ...@@ -237,8 +236,8 @@ make_name(void)
UNENCRYPTED, UNION, UNIQUE, UNKNOWN, UNLISTEN, UNTIL, UPDATE, USAGE, UNENCRYPTED, UNION, UNIQUE, UNKNOWN, UNLISTEN, UNTIL, UPDATE, USAGE,
USER, USING, USER, USING,
VACUUM, VALID, VALIDATOR, VALUES, VARCHAR, VARYING, VERBOSE, VERSION, VIEW, VOLATILE, VACUUM, VALID, VALUES, VARCHAR, VARYING, VERBOSE, VERSION, VIEW, VOLATILE,
WHEN, WHERE, WITH, WITHOUT, WORK, WRITE WHEN, WHERE, WITH, WITHOUT, WORK,
YEAR_P, YEAR_P,
ZONE ZONE
...@@ -265,7 +264,7 @@ make_name(void) ...@@ -265,7 +264,7 @@ make_name(void)
%right NOT %right NOT
%right '=' %right '='
%nonassoc '<' '>' %nonassoc '<' '>'
%nonassoc LIKE ILIKE SIMILAR %nonassoc LIKE ILIKE
%nonassoc ESCAPE %nonassoc ESCAPE
%nonassoc OVERLAPS %nonassoc OVERLAPS
%nonassoc BETWEEN %nonassoc BETWEEN
...@@ -283,7 +282,6 @@ make_name(void) ...@@ -283,7 +282,6 @@ make_name(void)
%right UMINUS %right UMINUS
%left '[' ']' %left '[' ']'
%left '(' ')' %left '(' ')'
%left COLLATE
%left TYPECAST %left TYPECAST
%left '.' %left '.'
...@@ -296,46 +294,46 @@ make_name(void) ...@@ -296,46 +294,46 @@ make_name(void)
%type <str> ConstraintElem key_actions ColQualList type_name DropSchemaStmt %type <str> ConstraintElem key_actions ColQualList type_name 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 qualified_name database_name %type <str> update_target_el opt_id qualified_name database_name
%type <str> access_method attr_name index_name name func_name opt_mode %type <str> access_method attr_name index_name name func_name
%type <str> file_name AexprConst c_expr ConstTypename var_list copy_from %type <str> file_name AexprConst c_expr ConstTypename var_list
%type <str> in_expr_nodes a_expr b_expr TruncateStmt CommentStmt %type <str> in_expr_nodes a_expr b_expr TruncateStmt CommentStmt
%type <str> opt_indirection expr_list extract_list extract_arg copy_opt_item %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 attrs drop_behavior TableLikeClause %type <str> trim_list in_expr substr_for attrs drop_behavior
%type <str> Typename SimpleTypename Generic Numeric 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 opt_timezone opt_interval table_ref copy_opt_list %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
%type <str> sortby OptUseOp qualified_name_list name_list ColId_or_Sconst %type <str> sortby OptUseOp qualified_name_list name_list ColId_or_Sconst
%type <str> group_clause having_clause from_clause opt_distinct opt_oids %type <str> group_clause having_clause from_clause opt_distinct
%type <str> join_outer where_clause relation_expr sub_type opt_arg %type <str> join_outer where_clause relation_expr sub_type opt_arg
%type <str> opt_column_list insert_rest InsertStmt OptimizableStmt %type <str> opt_column_list insert_rest InsertStmt OptimizableStmt
%type <str> columnList DeleteStmt LockStmt UpdateStmt CursorStmt %type <str> columnList DeleteStmt LockStmt UpdateStmt CursorStmt
%type <str> NotifyStmt columnElem UnlistenStmt %type <str> NotifyStmt columnElem copy_dirn UnlistenStmt copy_null
%type <str> copy_delimiter ListenStmt CopyStmt copy_file_name opt_binary %type <str> copy_delimiter ListenStmt CopyStmt copy_file_name opt_binary
%type <str> FetchStmt direction fetch_how_many from_in %type <str> opt_with_copy FetchStmt direction fetch_how_many from_in
%type <str> ClosePortalStmt DropStmt VacuumStmt AnalyzeStmt opt_verbose %type <str> ClosePortalStmt DropStmt VacuumStmt AnalyzeStmt opt_verbose
%type <str> opt_full func_arg OptWithOids opt_freeze opt_ecpg_into %type <str> opt_full func_arg OptWithOids opt_freeze opt_ecpg_into
%type <str> analyze_keyword opt_name_list ExplainStmt index_params %type <str> analyze_keyword opt_name_list ExplainStmt index_params
%type <str> index_list func_index index_elem opt_class access_method_clause %type <str> index_list func_index index_elem opt_class access_method_clause
%type <str> index_opt_unique IndexStmt func_return ConstInterval %type <str> index_opt_unique IndexStmt func_return ConstInterval
%type <str> func_args_list func_args opt_with def_arg add_drop overlay_list %type <str> func_args_list func_args opt_with def_arg
%type <str> def_elem def_list definition DefineStmt select_with_parens %type <str> def_elem def_list definition DefineStmt select_with_parens
%type <str> opt_instead event RuleActionList opt_using CreateAssertStmt %type <str> opt_instead event RuleActionList opt_using CreateAssertStmt
%type <str> RuleActionStmtOrEmpty RuleActionMulti func_as reindex_type %type <str> RuleActionStmtOrEmpty RuleActionMulti func_as reindex_type
%type <str> RuleStmt opt_column opt_name oper_argtypes NumConst %type <str> RuleStmt opt_column opt_name oper_argtypes NumConst
%type <str> MathOp RemoveFuncStmt aggr_argtype for_update_clause %type <str> MathOp RemoveFuncStmt aggr_argtype for_update_clause
%type <str> RemoveAggrStmt opt_procedural select_no_parens opt_validator %type <str> RemoveAggrStmt opt_procedural select_no_parens
%type <str> RemoveOperStmt RenameStmt all_Op opt_trusted opt_lancompiler %type <str> RemoveOperStmt RenameStmt all_Op opt_Trusted opt_lancompiler
%type <str> VariableSetStmt var_value zone_value VariableShowStmt %type <str> VariableSetStmt var_value zone_value VariableShowStmt
%type <str> VariableResetStmt AlterTableStmt from_list overlay_placing %type <str> VariableResetStmt AlterTableStmt from_list
%type <str> opt_trans user_list OptUserList OptUserElem relation_name %type <str> opt_trans user_list OptUserList OptUserElem relation_name
%type <str> CreateUserStmt AlterUserStmt CreateSeqStmt OptSeqList %type <str> CreateUserStmt AlterUserStmt CreateSeqStmt OptSeqList
%type <str> OptSeqElem TriggerForSpec TriggerForOpt TriggerForType %type <str> OptSeqElem TriggerForSpec TriggerForOpt TriggerForType
%type <str> DropTrigStmt TriggerOneEvent TriggerEvents RuleActionStmt %type <str> DropTrigStmt TriggerOneEvent TriggerEvents RuleActionStmt
%type <str> TriggerActionTime CreateTrigStmt DropPLangStmt opt_assignment %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 opt_equal %type <str> createdb_opt_list opt_encoding OptInherit opt_equal
...@@ -352,7 +350,7 @@ make_name(void) ...@@ -352,7 +350,7 @@ make_name(void)
%type <str> join_qual update_list AlterSchemaStmt joined_table %type <str> join_qual update_list AlterSchemaStmt joined_table
%type <str> opt_level opt_lock lock_type OptGroupList OptGroupElem %type <str> opt_level opt_lock lock_type OptGroupList OptGroupElem
%type <str> OptConstrFromTable OptTempTableName StringConst %type <str> OptConstrFromTable OptTempTableName StringConst
%type <str> constraints_set_mode comment_type opt_definition %type <str> constraints_set_mode comment_type opt_empty_parentheses
%type <str> CreateGroupStmt AlterGroupStmt DropGroupStmt key_delete %type <str> CreateGroupStmt AlterGroupStmt DropGroupStmt key_delete
%type <str> opt_force key_update CreateSchemaStmt PosIntStringConst %type <str> opt_force key_update CreateSchemaStmt PosIntStringConst
%type <str> IntConst PosIntConst grantee_list func_type opt_or_replace %type <str> IntConst PosIntConst grantee_list func_type opt_or_replace
...@@ -381,7 +379,7 @@ make_name(void) ...@@ -381,7 +379,7 @@ make_name(void)
%type <str> struct_type s_struct vt_declarations variable_declarations %type <str> struct_type s_struct vt_declarations variable_declarations
%type <str> var_declaration type_declaration %type <str> var_declaration type_declaration
%type <str> s_union union_type ECPGSetAutocommit on_off %type <str> s_union union_type ECPGSetAutocommit on_off
%type <str> ECPGAllocateDescr ECPGDeallocateDescr opt_symbol %type <str> ECPGAllocateDescr ECPGDeallocateDescr symbol opt_symbol
%type <str> ECPGGetDescriptorHeader ECPGColLabel %type <str> ECPGGetDescriptorHeader ECPGColLabel
%type <str> reserved_keyword unreserved_keyword %type <str> reserved_keyword unreserved_keyword
%type <str> col_name_keyword func_name_keyword %type <str> col_name_keyword func_name_keyword
...@@ -400,6 +398,8 @@ make_name(void) ...@@ -400,6 +398,8 @@ make_name(void)
%type <index> opt_array_bounds opt_type_array_bounds %type <index> opt_array_bounds opt_type_array_bounds
%type <ival> Iresult %type <ival> Iresult
%token YYERROR_VERBOSE
%% %%
prog: statements; prog: statements;
...@@ -659,14 +659,12 @@ stmt: AlterDatabaseSetStmt { output_statement($1, 0, connection); } ...@@ -659,14 +659,12 @@ stmt: AlterDatabaseSetStmt { output_statement($1, 0, connection); }
* *
*****************************************************************************/ *****************************************************************************/
CreateUserStmt: CREATE USER UserId opt_with OptUserList CreateUserStmt: CREATE USER UserId OptUserList
{ $$ = cat_str(4, make_str("create user"), $3, $4, $5); } { $$ = cat_str(3, make_str("create user"), $3, $4); }
| CREATE USER UserId WITH OptUserList
{ $$ = cat_str(4, make_str("create user"), $3, make_str("with"), $5); }
; ;
opt_with: WITH { $$ = make_str("with"); }
| /* EMPTY */ { $$ = EMPTY; }
;
/***************************************************************************** /*****************************************************************************
* *
* Alter a postgresql DBMS user * Alter a postgresql DBMS user
...@@ -674,8 +672,10 @@ opt_with: WITH { $$ = make_str("with"); } ...@@ -674,8 +672,10 @@ opt_with: WITH { $$ = make_str("with"); }
* *
*****************************************************************************/ *****************************************************************************/
AlterUserStmt: ALTER USER UserId opt_with OptUserList AlterUserStmt: ALTER USER UserId OptUserList
{ $$ = cat_str(4, make_str("alter user"), $3, $4, $5); } { $$ = cat_str(3, make_str("alter user"), $3, $4); }
| ALTER USER UserId WITH OptUserList
{ $$ = cat_str(4, make_str("alter user"), $3, make_str("with"), $5); }
; ;
AlterUserSetStmt: ALTER USER UserId SET set_rest AlterUserSetStmt: ALTER USER UserId SET set_rest
...@@ -702,11 +702,7 @@ OptUserList: OptUserList OptUserElem { $$ = cat2_str($1, $2); } ...@@ -702,11 +702,7 @@ OptUserList: OptUserList OptUserElem { $$ = cat2_str($1, $2); }
; ;
OptUserElem: PASSWORD Sconst OptUserElem: PASSWORD Sconst
{ $$ = cat2_str(make_str("password"), $2); } { $$ = cat2_str(make_str("password"), $2); }
| ENCRYPTED PASSWORD Sconst
{ $$ = cat2_str(make_str("encrypted password"), $3); }
| UNENCRYPTED PASSWORD Sconst
{ $$ = cat2_str(make_str("unencrypted password"), $3); }
| SYSID Iconst | SYSID Iconst
{ $$ = cat2_str(make_str("sysid"), $2); } { $$ = cat2_str(make_str("sysid"), $2); }
| CREATEDB | CREATEDB
...@@ -735,8 +731,10 @@ user_list: user_list ',' UserId ...@@ -735,8 +731,10 @@ user_list: user_list ',' UserId
* *
* *
****************************************************************************/ ****************************************************************************/
CreateGroupStmt: CREATE GROUP_P UserId opt_with OptGroupList CreateGroupStmt: CREATE GROUP_P UserId OptGroupList
{ $$ = cat_str(4, make_str("create group"), $3, $4, $5); } { $$ = cat_str(3, make_str("create group"), $3, $4); }
| CREATE GROUP_P UserId WITH OptGroupList
{ $$ = cat_str(4, make_str("create group"), $3, make_str("with"), $5); }
; ;
/* /*
...@@ -759,14 +757,12 @@ OptGroupElem: USER user_list ...@@ -759,14 +757,12 @@ OptGroupElem: USER user_list
* *
* *
*****************************************************************************/ *****************************************************************************/
AlterGroupStmt: ALTER GROUP_P UserId add_drop USER user_list AlterGroupStmt: ALTER GROUP_P UserId ADD USER user_list
{ $$ = cat_str(4, make_str("alter group"), $3, $4, make_str("user"), $6); } { $$ = cat_str(4, make_str("alter group"), $3, make_str("add user"), $6); }
| ALTER GROUP_P UserId DROP USER user_list
{ $$ = cat_str(4, make_str("alter group"), $3, make_str("drop user"), $6); }
; ;
add_drop: ADD { $$ = make_str("add"); }
| DROP { $$ = make_str("drop"); }
;
/***************************************************************************** /*****************************************************************************
* *
* Drop a postgresql group * Drop a postgresql group
...@@ -839,8 +835,8 @@ set_rest: ColId TO var_list_or_default ...@@ -839,8 +835,8 @@ set_rest: ColId TO var_list_or_default
{ $$ = cat_str(3, $1, make_str("="), $3); } { $$ = cat_str(3, $1, make_str("="), $3); }
| TIME ZONE zone_value | TIME ZONE zone_value
{ $$ = cat2_str(make_str("time zone"), $3); } { $$ = cat2_str(make_str("time zone"), $3); }
| TRANSACTION ISOLATION LEVEL opt_level opt_mode | TRANSACTION ISOLATION LEVEL opt_level
{ $$ = cat_str(3, make_str("transaction isolation level"), $4, $5); } { $$ = cat2_str(make_str("transaction isolation level"), $4); }
| SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL opt_level | SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL opt_level
{ $$ = cat2_str(make_str("session characteristics as transaction isolation level"), $7); } { $$ = cat2_str(make_str("session characteristics as transaction isolation level"), $7); }
| NAMES opt_encoding | NAMES opt_encoding
...@@ -867,13 +863,6 @@ opt_level: READ COMMITTED { $$ = make_str("read committed"); } ...@@ -867,13 +863,6 @@ opt_level: READ COMMITTED { $$ = make_str("read committed"); }
| SERIALIZABLE { $$ = make_str("serializable"); } | SERIALIZABLE { $$ = make_str("serializable"); }
; ;
opt_mode: READ WRITE { $$ = make_str("read write"); }
| READ ONLY {
mmerror(PARSE_ERROR, ET_WARNING, "Currently unsupported SET TRANSACTION/READ ONLY will be passed to backend");
$$ = make_str("read copy");
}
| /* EMPTY */ { $$ = EMPTY; }
;
var_value: opt_boolean { $$ = $1; } var_value: opt_boolean { $$ = $1; }
| AllConst { $$ = $1; } | AllConst { $$ = $1; }
...@@ -1032,19 +1021,16 @@ opt_id: ColId { $$ = $1; } ...@@ -1032,19 +1021,16 @@ opt_id: ColId { $$ = $1; }
/***************************************************************************** /*****************************************************************************
* *
* QUERY : * QUERY :
* COPY <relname> FROM/TO [WITH options] * COPY [BINARY] <relname> FROM/TO
* * [USING DELIMITERS <delimiter>]
* BINARY, OIDS, and DELIMITERS kept in old locations
* for backward compatibility. 2002-06-18
* *
*****************************************************************************/ *****************************************************************************/
CopyStmt: COPY opt_binary qualified_name opt_oids copy_from CopyStmt: COPY opt_binary qualified_name opt_with_copy copy_dirn copy_file_name copy_delimiter copy_null
copy_file_name copy_delimiter opt_with copy_opt_list { $$ = cat_str(8, make_str("copy"), $2, $3, $4, $5, $6, $7, $8); }
{ $$ = cat_str(9, make_str("copy"), $2, $3, $4, $5, $6, $7, $8i, $9); }
; ;
copy_from: TO { $$ = make_str("to"); } copy_dirn: TO { $$ = make_str("to"); }
| FROM { $$ = make_str("from"); } | FROM { $$ = make_str("from"); }
; ;
...@@ -1057,24 +1043,18 @@ copy_file_name: StringConst { $$ = $1; } ...@@ -1057,24 +1043,18 @@ copy_file_name: StringConst { $$ = $1; }
| STDIN { $$ = make_str("stdin"); } | STDIN { $$ = make_str("stdin"); }
| STDOUT { $$ = make_str("stdout"); } | STDOUT { $$ = make_str("stdout"); }
; ;
copy_opt_list: copy_opt_list copy_opt_item { $$ = cat2_str($1, $2); }
| /*EMPTY*/ { $$ = EMPTY; }
;
copy_opt_item: BINARY { $$ = make_str("binary"); }
| OIDS { $$ = make_str("oids"); }
| DELIMITER opt_as Sconst { $$ = cat_str(3, make_str("delimiter"), $2, $3); }
| NULL_P opt_as Sconst { $$ = cat_str(3, make_str("null"), $2, $3); }
;
opt_binary: BINARY { $$ = make_str("binary"); } opt_binary: BINARY { $$ = make_str("binary"); }
| /*EMPTY*/ { $$ = EMPTY; } | /*EMPTY*/ { $$ = EMPTY; }
; ;
opt_oids: WITH OIDS { $$ = make_str("with oids"); }
| /*EMPTY*/ { $$ = EMPTY; } opt_with_copy: WITH OIDS { $$ = make_str("with oids"); }
| /*EMPTY*/ { $$ = EMPTY; }
; ;
/*
* the default copy delimiter is tab but the user can configure it
*/
copy_delimiter: opt_using DELIMITERS StringConst copy_delimiter: opt_using DELIMITERS StringConst
{ $$ = cat_str(3, $1, make_str("delimiters"), $3); } { $$ = cat_str(3, $1, make_str("delimiters"), $3); }
| /*EMPTY*/ | /*EMPTY*/
...@@ -1085,6 +1065,12 @@ opt_using: USING { $$ = make_str("using"); } ...@@ -1085,6 +1065,12 @@ opt_using: USING { $$ = make_str("using"); }
| /* EMPTY */ { $$ = EMPTY; } | /* EMPTY */ { $$ = EMPTY; }
; ;
copy_null: WITH NULL_P AS StringConst
{ $$ = cat2_str(make_str("with null as"), $4); }
| /* EMPTY */
{ $$ = EMPTY; }
;
/***************************************************************************** /*****************************************************************************
* *
* QUERY : * QUERY :
...@@ -1128,7 +1114,6 @@ OptTableElementList: OptTableElementList ',' OptTableElement ...@@ -1128,7 +1114,6 @@ OptTableElementList: OptTableElementList ',' OptTableElement
; ;
OptTableElement: columnDef { $$ = $1; } OptTableElement: columnDef { $$ = $1; }
| TableLikeClause { $$ = $1; }
| TableConstraint { $$ = $1; } | TableConstraint { $$ = $1; }
; ;
...@@ -1197,9 +1182,6 @@ ConstraintAttr: DEFERRABLE { $$ = make_str("deferrable"); } ...@@ -1197,9 +1182,6 @@ ConstraintAttr: DEFERRABLE { $$ = make_str("deferrable"); }
| INITIALLY IMMEDIATE { $$ = make_str("initially immediate"); } | INITIALLY IMMEDIATE { $$ = make_str("initially immediate"); }
; ;
TableLikeClause: LIKE any_name { $$ = cat2_str(make_str("like"), $2); }
;
/* ConstraintElem specifies constraint syntax which is not embedded into /* ConstraintElem specifies constraint syntax which is not embedded into
* a column definition. ColConstraintElem specifies the embedded form. * a column definition. ColConstraintElem specifies the embedded form.
* - thomas 1997-12-03 * - thomas 1997-12-03
...@@ -1241,8 +1223,6 @@ key_match: MATCH FULL ...@@ -1241,8 +1223,6 @@ key_match: MATCH FULL
mmerror(PARSE_ERROR, ET_WARNING, "Currently unsupported FOREIGN KEY/MATCH PARTIAL will be passed to backend"); mmerror(PARSE_ERROR, ET_WARNING, "Currently unsupported FOREIGN KEY/MATCH PARTIAL will be passed to backend");
$$ = make_str("match partial"); $$ = make_str("match partial");
} }
| MATCH SIMPLE
{ $$ = make_str("match simple"); }
| /*EMPTY*/ | /*EMPTY*/
{ $$ = EMPTY; } { $$ = EMPTY; }
; ;
...@@ -1349,12 +1329,12 @@ OptSeqElem: CACHE NumConst ...@@ -1349,12 +1329,12 @@ OptSeqElem: CACHE NumConst
* *
*****************************************************************************/ *****************************************************************************/
CreatePLangStmt: CREATE opt_trusted opt_procedural LANGUAGE ColId_or_Sconst CreatePLangStmt: CREATE opt_Trusted opt_procedural LANGUAGE ColId_or_Sconst
HANDLER handler_name opt_validator opt_lancompiler HANDLER handler_name opt_lancompiler
{ $$ = cat_str(8, make_str("create"), $2, $3, make_str("language"), $5, make_str("handler"), $7, $8); } { $$ = cat_str(8, make_str("create"), $2, $3, make_str("language"), $5, make_str("handler"), $7, $8); }
; ;
opt_trusted: TRUSTED { $$ = make_str("trusted"); } opt_Trusted: TRUSTED { $$ = make_str("trusted"); }
| /*EMPTY*/ { $$ = EMPTY; } | /*EMPTY*/ { $$ = EMPTY; }
; ;
...@@ -1374,10 +1354,6 @@ opt_lancompiler: LANCOMPILER StringConst ...@@ -1374,10 +1354,6 @@ opt_lancompiler: LANCOMPILER StringConst
{ $$ = ""; } { $$ = ""; }
; ;
opt_validator: VALIDATOR handler_name { $$ = cat2_str(make_str("validator"), $2); }
| /* EMPTY */ { $$ = EMPTY; }
;
DropPLangStmt: DROP opt_procedural LANGUAGE StringConst DropPLangStmt: DROP opt_procedural LANGUAGE StringConst
{ $$ = cat_str(4, make_str("drop"), $2, make_str("language"), $4); } { $$ = cat_str(4, make_str("drop"), $2, make_str("language"), $4); }
; ;
...@@ -1468,7 +1444,6 @@ ConstraintAttributeSpec: ConstraintDeferrabilitySpec { $$ = $1; } ...@@ -1468,7 +1444,6 @@ ConstraintAttributeSpec: ConstraintDeferrabilitySpec { $$ = $1; }
$$ = cat2_str($1, $2); $$ = cat2_str($1, $2);
} }
| /*EMPTY*/ { $$ = EMPTY; }
; ;
ConstraintDeferrabilitySpec: NOT DEFERRABLE ConstraintDeferrabilitySpec: NOT DEFERRABLE
...@@ -1844,32 +1819,18 @@ RecipeStmt: EXECUTE RECIPE recipe_name ...@@ -1844,32 +1819,18 @@ RecipeStmt: EXECUTE RECIPE recipe_name
*****************************************************************************/ *****************************************************************************/
CreateFunctionStmt: CREATE opt_or_replace FUNCTION func_name func_args CreateFunctionStmt: CREATE opt_or_replace FUNCTION func_name func_args
RETURNS func_return createfunc_opt_list opt_definition RETURNS func_return createfunc_opt_list opt_with
{ $$ = cat_str(8, make_str("create"), $2, make_str("function"), $4, $5, make_str("returns"), $7, $8); } { $$ = cat_str(8, make_str("create"), $2, make_str("function"), $4, $5, make_str("returns"), $7, $8); }
| CREATE opt_or_replace CAST '(' func_type AS func_type ')'
WITH FUNCTION func_name func_args opt_assignment opt_definition
{ $$ = cat_str(11, make_str("create"), $2, make_str("cast ("), $5, make_str("as"), $7, make_str(") with function"), $11, $12, $13, $14); }
| CREATE opt_or_replace CAST '(' func_type AS func_type ')'
WITH FUNCTION func_name func_args AS Sconst opt_definition
{ $$ = cat_str(12, make_str("create"), $2, make_str("cast ("), $5, make_str("as"), $7, make_str(") with function"), $11, $12, make_str("as)", $14, $15); }
| CREATE opt_or_replace CAST '(' func_type AS func_type ')'
createfunc_opt_list opt_definition
{ $$ = cat_str(i9, make_str("create"), $2, make_str("cast ("), $5, make_str("as"), $7, make_str(")"), $9, $10); }
; ;
opt_or_replace: OR REPLACE { $$ = make_str("or replace"); } opt_or_replace: OR REPLACE { $$ = make_str("or replace"); }
| /*EMPTY*/ { $$ = EMPTY; } | /*EMPTY*/ { $$ = EMPTY; }
; ;
opt_definition: WITH definition { $$ = cat2_str(make_str("with"), $2); } opt_with: WITH definition { $$ = cat2_str(make_str("with"), $2); }
| /*EMPTY*/ { $$ = EMPTY; } | /*EMPTY*/ { $$ = EMPTY; }
;
opt_assignment: AS ASSIGNMENT { $$ = make_str("as assignment"); }
| /*EMPTY*/ { $$ = EMPTY; }
; ;
func_args: '(' func_args_list ')' func_args: '(' func_args_list ')'
{ $$ = cat_str(3, make_str("("), $2, make_str(")")); } { $$ = cat_str(3, make_str("("), $2, make_str(")")); }
| '(' ')' | '(' ')'
...@@ -1975,16 +1936,8 @@ createfunc_opt_item: AS func_as ...@@ -1975,16 +1936,8 @@ createfunc_opt_item: AS func_as
* *
*****************************************************************************/ *****************************************************************************/
RemoveFuncStmt: DROP FUNCTION func_name func_args opt_drop_behavior RemoveFuncStmt: DROP FUNCTION func_name func_args
{ { $$ = cat_str(3, make_str("drop function"), $3, $4); }
if (strcmp($5, "restrict") != 0)
mmerror(PARSE_ERROR, ET_WARNING, "Unsupported DROP FUNCTION/CASCADE will be passed to backend");
$$ = cat_str(4, make_str("drop function"), $3, $4, $5);
}
| DROP CAST '(' func_type AS func_type ')' opt_drop_behavior
{
$$ = cat_str(6, make_str("drop cast ("), $4, make_Str("as"), $6, make_str(")", $8);
}
; ;
RemoveAggrStmt: DROP AGGREGATE func_name '(' aggr_argtype ')' RemoveAggrStmt: DROP AGGREGATE func_name '(' aggr_argtype ')'
...@@ -2194,14 +2147,16 @@ LoadStmt: LOAD file_name ...@@ -2194,14 +2147,16 @@ LoadStmt: LOAD file_name
* *
*****************************************************************************/ *****************************************************************************/
CreatedbStmt: CREATE DATABASE database_name opt_with createdb_opt_list CreatedbStmt: CREATE DATABASE database_name WITH createdb_opt_list
{ $$ = cat_str(4, make_str("create database"), $3, $4, $5); } { $$ = cat_str(4, make_str("create database"), $3, make_str("with"), $5); }
| CREATE DATABASE database_name
{ $$ = cat2_str(make_str("create database"), $3); }
; ;
createdb_opt_list: createdb_opt_list createdb_opt_item createdb_opt_list: createdb_opt_item
{ $$ = $1; }
| createdb_opt_list createdb_opt_item
{ $$ = cat2_str($1, $2); } { $$ = cat2_str($1, $2); }
| /* EMPTY */
{ $$ = EMPTY; }
; ;
createdb_opt_item: LOCATION opt_equal StringConst createdb_opt_item: LOCATION opt_equal StringConst
...@@ -3083,8 +3038,6 @@ a_expr: c_expr ...@@ -3083,8 +3038,6 @@ a_expr: c_expr
{ $$ = $1; } { $$ = $1; }
| a_expr TYPECAST Typename | a_expr TYPECAST Typename
{ $$ = cat_str(3, $1, make_str("::"), $3); } { $$ = cat_str(3, $1, make_str("::"), $3); }
| a_expr COLLATE Typename
{ $$ = cat_str(3, $1, make_str("collate"), $3); }
| a_expr AT TIME ZONE c_expr | a_expr AT TIME ZONE c_expr
{ $$ = cat_str(3, $1, make_str("at time zone"), $5); } { $$ = cat_str(3, $1, make_str("at time zone"), $5); }
/* /*
...@@ -3154,14 +3107,6 @@ a_expr: c_expr ...@@ -3154,14 +3107,6 @@ a_expr: c_expr
{ $$ = cat_str(3, $1, make_str("not ilike"), $4); } { $$ = cat_str(3, $1, make_str("not ilike"), $4); }
| a_expr NOT ILIKE a_expr ESCAPE a_expr | a_expr NOT ILIKE a_expr ESCAPE a_expr
{ $$ = cat_str(5, $1, make_str("not ilike"), $4, make_str("escape"), $6); } { $$ = cat_str(5, $1, make_str("not ilike"), $4, make_str("escape"), $6); }
| a_expr SIMILAR TO a_expr %prec SIMILAR
{ $$ = cat_str(3, $1, make_str("similar to"), $4); }
| a_expr SIMILAR TO a_expr ESCAPE a_expr
{ $$ = cat_str(5, $1, make_str("similar to"), $4, make_str("escape"), $6); }
| a_expr NOT SIMILAR TO a_expr %prec SIMILAR
{ $$ = cat_str(3, $1, make_str("not similar to"), $5); }
| a_expr NOT SIMILAR TO a_expr ESCAPE a_expr
{ $$ = cat_str(5, $1, make_str("not similar to"), $5, make_str("escape"), $7); }
| a_expr ISNULL | a_expr ISNULL
{ $$ = cat2_str($1, make_str("isnull")); } { $$ = cat2_str($1, make_str("isnull")); }
| a_expr IS NULL_P | a_expr IS NULL_P
...@@ -3287,32 +3232,22 @@ c_expr: columnref ...@@ -3287,32 +3232,22 @@ c_expr: columnref
{ $$ = cat2_str($1, make_str("(*)")); } { $$ = cat2_str($1, make_str("(*)")); }
| CURRENT_DATE | CURRENT_DATE
{ $$ = make_str("current_date"); } { $$ = make_str("current_date"); }
| CURRENT_TIME | CURRENT_TIME opt_empty_parentheses
{ $$ = make_str("current_time"); } { $$ = cat2_str(make_str("current_time"), $2); }
| CURRENT_TIME '(' PosIntConst ')' | CURRENT_TIME '(' PosIntConst ')'
{ $$ = make_str("current_time"); } { $$ = make_str("current_time"); }
| CURRENT_TIMESTAMP | CURRENT_TIMESTAMP opt_empty_parentheses
{ $$ = make_str("current_timestamp"); } { $$ = cat2_str(make_str("current_timestamp"), $2); }
| CURRENT_TIMESTAMP '(' PosIntConst ')' | CURRENT_TIMESTAMP '(' PosIntConst ')'
{ $$ = make_str("current_timestamp"); } { $$ = make_str("current_timestamp"); }
| LOCALTIME | CURRENT_USER opt_empty_parentheses
{ $$ = make_str("localtime"); } { $$ = cat2_str(make_str("current_user"), $2); }
| LOCALTIME '(' Iconst ')' | SESSION_USER opt_empty_parentheses
{ $$ = cat_str(3, make_str("localtime ("), $3, make_str(")")); } { $$ = cat2_str(make_str("session_user"), $2); }
| LOCALTIMESTAMP | USER opt_empty_parentheses
{ $$ = make_str("localtimestamp"); } { $$ = cat2_str(make_str("user"), $2); }
| LOCALTIMESTAMP '(' Iconst ')'
{ $$ = cat_str(3, make_str("localtime ("), $3, make_str(")")); }
| CURRENT_USER
{ $$ = make_str("current_user"); }
| SESSION_USER
{ $$ = make_str("session_user"); }
| USER
{ $$ = make_str("user"); }
| EXTRACT '(' extract_list ')' | EXTRACT '(' extract_list ')'
{ $$ = cat_str(3, make_str("extract("), $3, make_str(")")); } { $$ = cat_str(3, make_str("extract("), $3, make_str(")")); }
| OVERLAY '(' overlay_list ')'
{ $$ = cat_str(3, make_str("overlay("), $3, make_str(")")); }
| POSITION '(' position_list ')' | POSITION '(' position_list ')'
{ $$ = cat_str(3, make_str("position("), $3, make_str(")")); } { $$ = cat_str(3, make_str("position("), $3, make_str(")")); }
| SUBSTRING '(' substr_list ')' | SUBSTRING '(' substr_list ')'
...@@ -3371,15 +3306,6 @@ extract_arg: IDENT { $$ = $1; } ...@@ -3371,15 +3306,6 @@ extract_arg: IDENT { $$ = $1; }
| StringConst { $$ = $1; } | StringConst { $$ = $1; }
; ;
overlay_list: a_expr overlay_placing substr_from substr_for
{ $$ = cat_str(4, $1, $2, $3, $4); }
| a_expr overlay_placing substr_from
{ $$ = cat_str(3, $1, $2, $3); }
;
overlay_placing: PLACING a_expr { $$ = cat2_str(make_str("placing"), $2); }
;
/* 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 */
position_list: b_expr IN_P b_expr position_list: b_expr IN_P b_expr
{ $$ = cat_str(3, $1, make_str("in"), $3); } { $$ = cat_str(3, $1, make_str("in"), $3); }
...@@ -3490,6 +3416,11 @@ attrs: '.' attr_name ...@@ -3490,6 +3416,11 @@ attrs: '.' attr_name
{ $$ = cat_str(3, make_str("."), $2, $3); } { $$ = cat_str(3, make_str("."), $2, $3); }
; ;
opt_empty_parentheses: '(' ')' { $$ = make_str("()"); }
| /*EMPTY*/ { $$ = EMPTY; }
;
/***************************************************************************** /*****************************************************************************
* *
* target lists * target lists
...@@ -4146,7 +4077,7 @@ type: simple_type ...@@ -4146,7 +4077,7 @@ type: simple_type
enum_type: SQL_ENUM opt_symbol enum_definition enum_type: SQL_ENUM opt_symbol enum_definition
{ $$ = cat_str(3, make_str("enum"), $2, $3); } { $$ = cat_str(3, make_str("enum"), $2, $3); }
| SQL_ENUM ColLabel | SQL_ENUM symbol
{ $$ = cat2_str(make_str("enum"), $2); } { $$ = cat2_str(make_str("enum"), $2); }
; ;
...@@ -4868,10 +4799,13 @@ ECPGTypeName: SQL_BOOL { $$ = make_str("bool"); } ...@@ -4868,10 +4799,13 @@ ECPGTypeName: SQL_BOOL { $$ = make_str("bool"); }
| SQL_UNSIGNED { $$ = make_str("unsigned"); } | SQL_UNSIGNED { $$ = make_str("unsigned"); }
; ;
opt_symbol: ColLabel opt_symbol: symbol { $$ = $1; }
| /*EMPTY*/ { $$ = EMPTY; } | /*EMPTY*/ { $$ = EMPTY; }
; ;
symbol: ColLabel { $$ = $1; }
;
/* /*
* Name classification hierarchy. * Name classification hierarchy.
* *
...@@ -4947,8 +4881,7 @@ unreserved_keyword: ...@@ -4947,8 +4881,7 @@ unreserved_keyword:
| AFTER { $$ = make_str("after"); } | AFTER { $$ = make_str("after"); }
| AGGREGATE { $$ = make_str("aggregate"); } | AGGREGATE { $$ = make_str("aggregate"); }
| ALTER { $$ = make_str("alter"); } | ALTER { $$ = make_str("alter"); }
| ASSERTION { $$ = make_str("assertion"); } | ASSERTION { $$ = make_str("assertion"); }
| ASSIGNMENT { $$ = make_str("assignment"); }
| AT { $$ = make_str("at"); } | AT { $$ = make_str("at"); }
| BACKWARD { $$ = make_str("backward"); } | BACKWARD { $$ = make_str("backward"); }
| BEFORE { $$ = make_str("before"); } | BEFORE { $$ = make_str("before"); }
...@@ -4975,7 +4908,6 @@ unreserved_keyword: ...@@ -4975,7 +4908,6 @@ unreserved_keyword:
| DECLARE { $$ = make_str("declare"); } | DECLARE { $$ = make_str("declare"); }
| DEFERRED { $$ = make_str("deferred"); } | DEFERRED { $$ = make_str("deferred"); }
| DELETE_P { $$ = make_str("delete"); } | DELETE_P { $$ = make_str("delete"); }
| DELIMITER { $$ = make_str("delimiter"); }
| DELIMITERS { $$ = make_str("delimiters"); } | DELIMITERS { $$ = make_str("delimiters"); }
| DOMAIN_P { $$ = make_str("domain"); } | DOMAIN_P { $$ = make_str("domain"); }
| DOUBLE { $$ = make_str("double"); } | DOUBLE { $$ = make_str("double"); }
...@@ -4991,7 +4923,6 @@ unreserved_keyword: ...@@ -4991,7 +4923,6 @@ unreserved_keyword:
| FORCE { $$ = make_str("force"); } | FORCE { $$ = make_str("force"); }
| FORWARD { $$ = make_str("forward"); } | FORWARD { $$ = make_str("forward"); }
| FUNCTION { $$ = make_str("function"); } | FUNCTION { $$ = make_str("function"); }
| GET { $$ = make_str("get"); }
| GLOBAL { $$ = make_str("global"); } | GLOBAL { $$ = make_str("global"); }
| HANDLER { $$ = make_str("handler"); } | HANDLER { $$ = make_str("handler"); }
| HOUR_P { $$ = make_str("hour"); } | HOUR_P { $$ = make_str("hour"); }
...@@ -5064,8 +4995,6 @@ unreserved_keyword: ...@@ -5064,8 +4995,6 @@ unreserved_keyword:
| SET { $$ = make_str("set"); } | SET { $$ = make_str("set"); }
| SHARE { $$ = make_str("share"); } | SHARE { $$ = make_str("share"); }
| SHOW { $$ = make_str("show"); } | SHOW { $$ = make_str("show"); }
| SIMPLE { $$ = make_str("simple"); }
| STABLE { $$ = make_str("stable"); }
| START { $$ = make_str("start"); } | START { $$ = make_str("start"); }
| STATEMENT { $$ = make_str("statement"); } | STATEMENT { $$ = make_str("statement"); }
| STATISTICS { $$ = make_str("statistics"); } | STATISTICS { $$ = make_str("statistics"); }
...@@ -5090,14 +5019,12 @@ unreserved_keyword: ...@@ -5090,14 +5019,12 @@ unreserved_keyword:
| USAGE { $$ = make_str("usage"); } | USAGE { $$ = make_str("usage"); }
| VACUUM { $$ = make_str("vacuum"); } | VACUUM { $$ = make_str("vacuum"); }
| VALID { $$ = make_str("valid"); } | VALID { $$ = make_str("valid"); }
| VALIDATOR { $$ = make_str("validator"); }
| VALUES { $$ = make_str("values"); } | VALUES { $$ = make_str("values"); }
| VARYING { $$ = make_str("varying"); } | VARYING { $$ = make_str("varying"); }
| VERSION { $$ = make_str("version"); } | VERSION { $$ = make_str("version"); }
| VIEW { $$ = make_str("view"); } | VIEW { $$ = make_str("view"); }
| WITH { $$ = make_str("with"); } | WITH { $$ = make_str("with"); }
| WITHOUT { $$ = make_str("without"); } | WITHOUT { $$ = make_str("without"); }
| WRITE { $$ = make_str("write"); }
| WORK { $$ = make_str("work"); } | WORK { $$ = make_str("work"); }
| YEAR_P { $$ = make_str("year"); } | YEAR_P { $$ = make_str("year"); }
| ZONE { $$ = make_str("zone"); } | ZONE { $$ = make_str("zone"); }
...@@ -5135,7 +5062,6 @@ col_name_keyword: ...@@ -5135,7 +5062,6 @@ col_name_keyword:
| NONE { $$ = make_str("none"); } | NONE { $$ = make_str("none"); }
| NULLIF { $$ = make_str("nullif"); } | NULLIF { $$ = make_str("nullif"); }
| NUMERIC { $$ = make_str("numeric"); } | NUMERIC { $$ = make_str("numeric"); }
| OVERLAY { $$ = make_str("overlay"); }
| POSITION { $$ = make_str("position"); } | POSITION { $$ = make_str("position"); }
| REAL { $$ = make_str("real"); } | REAL { $$ = make_str("real"); }
| SETOF { $$ = make_str("setof"); } | SETOF { $$ = make_str("setof"); }
...@@ -5177,7 +5103,6 @@ func_name_keyword: ...@@ -5177,7 +5103,6 @@ func_name_keyword:
| OUTER_P { $$ = make_str("outer"); } | OUTER_P { $$ = make_str("outer"); }
| OVERLAPS { $$ = make_str("overlaps"); } | OVERLAPS { $$ = make_str("overlaps"); }
| RIGHT { $$ = make_str("right"); } | RIGHT { $$ = make_str("right"); }
| SIMILAR { $$ = make_str("similar"); }
| VERBOSE { $$ = make_str("verbose"); } | VERBOSE { $$ = make_str("verbose"); }
; ;
...@@ -5227,8 +5152,6 @@ reserved_keyword: ...@@ -5227,8 +5152,6 @@ reserved_keyword:
| INTO { $$ = make_str("into"); } | INTO { $$ = make_str("into"); }
| LEADING { $$ = make_str("leading"); } | LEADING { $$ = make_str("leading"); }
| LIMIT { $$ = make_str("limit"); } | LIMIT { $$ = make_str("limit"); }
| LOCALTIME { $$ = make_str("localtime"); }
| LOCALTIMESTAMP { $$ = make_str("localtimestamp"); }
| NEW { $$ = make_str("new"); } | NEW { $$ = make_str("new"); }
| NOT { $$ = make_str("not"); } | NOT { $$ = make_str("not"); }
| NULL_P { $$ = make_str("null"); } | NULL_P { $$ = make_str("null"); }
...@@ -5239,7 +5162,6 @@ reserved_keyword: ...@@ -5239,7 +5162,6 @@ reserved_keyword:
| ONLY { $$ = make_str("only"); } | ONLY { $$ = make_str("only"); }
| OR { $$ = make_str("or"); } | OR { $$ = make_str("or"); }
| ORDER { $$ = make_str("order"); } | ORDER { $$ = make_str("order"); }
| PLACING { $$ = make_str("playcing"); }
| PRIMARY { $$ = make_str("primary"); } | PRIMARY { $$ = make_str("primary"); }
| REFERENCES { $$ = make_str("references"); } | REFERENCES { $$ = make_str("references"); }
| SELECT { $$ = make_str("select"); } | SELECT { $$ = make_str("select"); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment