diff --git a/src/interfaces/ecpg/ChangeLog b/src/interfaces/ecpg/ChangeLog index e7d2e945dd..ae4bea358b 100644 --- a/src/interfaces/ecpg/ChangeLog +++ b/src/interfaces/ecpg/ChangeLog @@ -1296,6 +1296,14 @@ Sun Sep 1 11:13:04 CEST 2002 Wed Sep 11 10:43:17 CEST 2002 - Synced preproc.y with gram.y. + + +Fri Sep 20 07:57:42 CEST 2002 + + - Synced preproc.y with gram.y. + - Synced keywords.c. + - Deactivated backend functions PREPARE, EXECUTE and DEALLOCATE for + the time being. - Set ecpg version to 2.10.0. - Set library version to 3.4.0. diff --git a/src/interfaces/ecpg/preproc/keywords.c b/src/interfaces/ecpg/preproc/keywords.c index 7313eae775..f07edbb23e 100644 --- a/src/interfaces/ecpg/preproc/keywords.c +++ b/src/interfaces/ecpg/preproc/keywords.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.50.2.4 2002/09/01 09:31:58 meskes Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.50.2.5 2002/09/20 06:19:07 meskes Exp $ * *------------------------------------------------------------------------- */ @@ -145,6 +145,7 @@ static ScanKeyword ScanKeywords[] = { {"ilike", ILIKE}, {"immediate", IMMEDIATE}, {"immutable", IMMUTABLE}, + {"implicit", IMPLICIT_P}, {"in", IN_P}, {"increment", INCREMENT}, {"index", INDEX}, diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y index dec469cb02..2f5b1cf9ac 100644 --- a/src/interfaces/ecpg/preproc/preproc.y +++ b/src/interfaces/ecpg/preproc/preproc.y @@ -1,4 +1,4 @@ -/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.190.2.6 2002/09/11 08:50:29 meskes Exp $ */ +/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.190.2.7 2002/09/20 06:19:07 meskes Exp $ */ /* Copyright comment */ %{ @@ -203,7 +203,7 @@ make_name(void) GET GLOBAL GRANT GROUP_P HANDLER HAVING HOUR_P - ILIKE IMMEDIATE IMMUTABLE IN_P INCREMENT INDEX INHERITS + ILIKE IMMEDIATE IMMUTABLE IMPLICIT_P IN_P INCREMENT INDEX INHERITS INITIALLY INNER_P INOUT INPUT INSENSITIVE INSERT INSTEAD INT INTEGER INTERSECT INTERVAL INTO INVOKER IS ISNULL ISOLATION @@ -289,8 +289,8 @@ make_name(void) %type comment_text ConstraintDeferrabilitySpec TableElementList %type key_match ColLabel SpecialRuleRelation ColId columnDef %type ColConstraint ColConstraintElem drop_type Bconst -%type TableConstraint OptTableElementList Xconst prep_type_clause -%type ConstraintElem key_actions ColQualList type_name PrepareStmt +%type TableConstraint OptTableElementList Xconst +%type ConstraintElem key_actions ColQualList type_name %type target_list target_el update_target_list alias_clause %type update_target_el opt_id qualified_name database_name %type access_method attr_name index_name name func_name @@ -301,7 +301,7 @@ make_name(void) %type trim_list in_expr substr_for attrs TableFuncElement %type Typename SimpleTypename Numeric opt_float opt_numeric %type opt_decimal Character character opt_varying opt_charset -%type opt_collate opt_timezone opt_interval table_ref DeallocateStmt +%type opt_collate opt_timezone opt_interval table_ref %type row_descriptor row_list ConstDatetime trans_options %type SelectStmt into_clause OptTemp ConstraintAttributeSpec %type opt_table opt_all sort_clause sortby_list ConstraintAttr @@ -322,7 +322,7 @@ make_name(void) %type def_elem def_list definition DefineStmt select_with_parens %type opt_instead event RuleActionList opt_using CreateAssertStmt %type RuleActionStmtOrEmpty RuleActionMulti func_as reindex_type -%type RuleStmt opt_column opt_name oper_argtypes NumConst ExecuteStmt +%type RuleStmt opt_column opt_name oper_argtypes NumConst %type MathOp RemoveFuncStmt aggr_argtype for_update_clause %type RemoveAggrStmt opt_procedural select_no_parens CreateCastStmt %type RemoveOperStmt RenameStmt all_Op opt_Trusted opt_lancompiler @@ -362,13 +362,13 @@ make_name(void) %type CreateFunctionStmt createfunc_opt_list func_table %type DropUserStmt copy_from copy_opt_list opt_mode copy_opt_item %type opt_oids TableLikeClause key_action opt_definition -%type opt_assignment row r_expr qual_Op qual_all_Op opt_default +%type cast_context row r_expr qual_Op qual_all_Op opt_default %type CreateConversionStmt any_operator opclass_item_list -%type iso_level convert_list prep_type_list +%type iso_level convert_list %type convert_args type_list CharacterWithLength ConstCharacter %type CharacterWithoutLength BitWithLength BitWithoutLength -%type ConstBit GenericType TableFuncElementList execute_param_clause -%type execute_param_list opt_sort_clause +%type ConstBit GenericType TableFuncElementList +%type opt_sort_clause %type ECPGWhenever ECPGConnect connection_target ECPGOpen %type indicator ECPGExecute ECPGPrepare opt_ecpg_using ecpg_into @@ -456,7 +456,7 @@ stmt: AlterDatabaseSetStmt { output_statement($1, 0, connection); } | CreateTrigStmt { output_statement($1, 0, connection); } | CreateUserStmt { output_statement($1, 0, connection); } | ClusterStmt { output_statement($1, 0, connection); } - | DeallocateStmt { output_statement($1, 0, connection); } + /*| DeallocateStmt { output_statement($1, 0, connection); }*/ | DefineStmt { output_statement($1, 0, connection); } | DropStmt { output_statement($1, 0, connection); } | TruncateStmt { output_statement($1, 0, connection); } @@ -468,8 +468,7 @@ stmt: AlterDatabaseSetStmt { output_statement($1, 0, connection); } | DropTrigStmt { output_statement($1, 0, connection); } | DropRuleStmt { output_statement($1, 0, connection); } | DropUserStmt { output_statement($1, 0, connection); } - | ExplainStmt { output_statement($1, 0, connection); } - | ExecuteStmt { output_statement($1, 0, connection); } + | ExplainStmt { output_statement($1, 0, connection); }/* | ExecuteStmt { output_statement($1, 0, connection); }*/ | FetchStmt { output_statement($1, 1, connection); } | GrantStmt { output_statement($1, 0, connection); } | IndexStmt { output_statement($1, 0, connection); } @@ -477,7 +476,7 @@ stmt: AlterDatabaseSetStmt { output_statement($1, 0, connection); } | UnlistenStmt { output_statement($1, 0, connection); } | LockStmt { output_statement($1, 0, connection); } | NotifyStmt { output_statement($1, 0, connection); } - | PrepareStmt { output_statement($1, 0, connection); } +/* | PrepareStmt { output_statement($1, 0, connection); }*/ | ReindexStmt { output_statement($1, 0, connection); } | RemoveAggrStmt { output_statement($1, 0, connection); } | RemoveOperStmt { output_statement($1, 0, connection); } @@ -671,12 +670,15 @@ stmt: AlterDatabaseSetStmt { output_statement($1, 0, connection); } * *****************************************************************************/ -CreateUserStmt: CREATE USER UserId OptUserList - { $$ = cat_str(3, make_str("create user"), $3, $4); } - | CREATE USER UserId WITH OptUserList +CreateUserStmt: CREATE USER UserId opt_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 @@ -1865,7 +1867,7 @@ opt_class: any_name { $$ = $1; } ; CreateFunctionStmt: CREATE opt_or_replace FUNCTION func_name func_args - RETURNS func_return createfunc_opt_list opt_with + RETURNS func_return createfunc_opt_list opt_definition { $$ = cat_str(8, make_str("create"), $2, make_str("function"), $4, $5, make_str("returns"), $7, $8); } ; @@ -1873,10 +1875,6 @@ opt_or_replace: OR REPLACE { $$ = make_str("or replace"); } | /*EMPTY*/ { $$ = EMPTY; } ; -opt_with: WITH definition { $$ = cat2_str(make_str("with"), $2); } - | /*EMPTY*/ { $$ = EMPTY; } - ; - func_args: '(' func_args_list ')' { $$ = cat_str(3, make_str("("), $2, make_str(")")); } | '(' ')' @@ -2019,14 +2017,14 @@ any_operator: ; CreateCastStmt: CREATE CAST '(' ConstTypename AS ConstTypename ')' - WITH FUNCTION function_with_argtypes opt_assignment opt_definition - { $$ = cat_str(7, make_str("create cast ("), $4, make_str("as"), $6, make_str(") with function"), $10, $11); } - | CREATE CAST '(' ConstTypename AS ConstTypename ')' - WITH FUNCTION opt_assignment + WITH FUNCTION function_with_argtypes cast_context { $$ = cat_str(6, make_str("create cast ("), $4, make_str("as"), $6, make_str(") with function"), $10); } + | CREATE CAST '(' ConstTypename AS ConstTypename ')' + WITHOUT FUNCTION cast_context + { $$ = cat_str(6, make_str("create cast ("), $4, make_str("as"), $6, make_str(") without function"), $10); } ; -opt_assignment: AS ASSIGNMENT { $$ = make_str("as assignment"); } +cast_context: AS ASSIGNMENT { $$ = make_str("as assignment"); } | /*EMPTY*/ { $$ = EMPTY; } ; @@ -2363,54 +2361,38 @@ ExplainStmt: EXPLAIN opt_verbose OptimizableStmt { $$ = cat_str(4, make_str("explain"), $2, $3, $4); } ; -/***************************************************************************** - * - * QUERY: - * PREPARE [(args, ...)] AS - * - *****************************************************************************/ +/* + +conflicts with ecpg PrepareStmt: PREPARE name prep_type_clause AS OptimizableStmt { $$ = cat_str(5, make_str("prepare"), $2, $3, make_str("as"), $5); } ; prep_type_clause: '(' prep_type_list ')' { $$ = cat_str(3, make_str("("), $2, make_str(")")); } - | /* EMPTY */ { $$ = EMPTY; } + | /* EMPTY * / { $$ = EMPTY; } ; prep_type_list: Typename { $$ = $1; } | prep_type_list ',' Typename { $$ = cat_str(3, $1, make_str(","), $3); } ; -/***************************************************************************** - * - * QUERY: - * EXECUTE [(params, ...)] [INTO ...] - * - *****************************************************************************/ - ExecuteStmt: EXECUTE name execute_param_clause into_clause { $$ = cat_str(4, make_str("execute"), $2, $3, $4); } ; execute_param_clause: '(' execute_param_list ')' { $$ = cat_str(3, make_str("("), $2, make_str(")")); } - | /* EMPTY */ { $$ = EMPTY; } + | /* EMPTY * / { $$ = EMPTY; } ; execute_param_list: a_expr { $$ = $1; } | execute_param_list ',' a_expr { $$ = cat_str(3, $1, make_str(","), $3); } ; - -/***************************************************************************** - * - * QUERY: - * DEALLOCATE [PREPARE] - * - *****************************************************************************/ DeallocateStmt: DEALLOCATE name { $$ = cat2_str(make_str("deallocate"), $2); } | DEALLOCATE PREPARE name { $$ = cat2_str(make_str("deallocate prepare"), $3); } ; +*/ /***************************************************************************** * * @@ -4112,7 +4094,10 @@ ECPGCursorStmt: DECLARE name opt_cursor CURSOR FOR ident * prepared statement */ ECPGDeallocate: DEALLOCATE PREPARE ident - { $$ = cat_str(3, make_str("ECPGdeallocate(__LINE__, \""), $3, make_str("\");")); }; + { $$ = cat_str(3, make_str("ECPGdeallocate(__LINE__, \""), $3, make_str("\");")); } + | DEALLOCATE ident + { $$ = cat_str(2, make_str("ECPGdeallocate(__LINE__, \""), $2, make_str("\");")); } + ; /* * variable declaration inside the exec sql declare block @@ -5177,6 +5162,7 @@ unreserved_keyword: | HOUR_P { $$ = make_str("hour"); } | IMMEDIATE { $$ = make_str("immediate"); } | IMMUTABLE { $$ = make_str("immutable"); } + | IMPLICIT_P { $$ = make_str("implicit"); } | INCREMENT { $$ = make_str("increment"); } | INDEX { $$ = make_str("index"); } | INHERITS { $$ = make_str("inherits"); }