diff --git a/src/interfaces/ecpg/ChangeLog b/src/interfaces/ecpg/ChangeLog index 28aaca24e6..06c0414e15 100644 --- a/src/interfaces/ecpg/ChangeLog +++ b/src/interfaces/ecpg/ChangeLog @@ -2169,7 +2169,6 @@ Fr Feb 2 09:53:48 CET 2007 Su Feb 11 16:09:31 CET 2007 - Fixed multibyte handling as reported by . - - Set ecpg library version to 5.3. Th Mar 15 08:27:53 CET 2007 @@ -2208,4 +2207,9 @@ Mon, 11 Jun 2007 13:59:57 +0200 - Fixed memory leak in descriptor code. - Made ecpg delete output file in case of an error. + +Tue, 12 Jun 2007 09:46:03 +0200 + + - Synced parser and keyword list. + - Set ecpg library version to 5.3. - Set ecpg version to 4.3.1. diff --git a/src/interfaces/ecpg/preproc/ecpg_keywords.c b/src/interfaces/ecpg/preproc/ecpg_keywords.c index 71df4ad1ba..3244880151 100644 --- a/src/interfaces/ecpg/preproc/ecpg_keywords.c +++ b/src/interfaces/ecpg/preproc/ecpg_keywords.c @@ -4,7 +4,7 @@ * lexical token lookup for reserved words in postgres embedded SQL * * IDENTIFICATION - * $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg_keywords.c,v 1.34 2007/05/10 09:53:16 meskes Exp $ + * $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg_keywords.c,v 1.35 2007/06/12 07:55:56 meskes Exp $ * *------------------------------------------------------------------------- */ @@ -33,7 +33,6 @@ static ScanKeyword ScanKeywords[] = { {"connect", SQL_CONNECT}, {"continue", SQL_CONTINUE}, {"count", SQL_COUNT}, - {"current", SQL_CURRENT}, {"data", SQL_DATA}, {"datetime_interval_code", SQL_DATETIME_INTERVAL_CODE}, {"datetime_interval_precision", SQL_DATETIME_INTERVAL_PRECISION}, diff --git a/src/interfaces/ecpg/preproc/keywords.c b/src/interfaces/ecpg/preproc/keywords.c index beff5805bc..f2f3094e06 100644 --- a/src/interfaces/ecpg/preproc/keywords.c +++ b/src/interfaces/ecpg/preproc/keywords.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.79 2007/05/10 09:53:16 meskes Exp $ + * $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.80 2007/06/12 07:55:56 meskes Exp $ * *------------------------------------------------------------------------- */ @@ -99,6 +99,7 @@ static ScanKeyword ScanKeywords[] = { {"createuser", CREATEUSER}, {"cross", CROSS}, {"csv", CSV}, + {"current", CURRENT_P}, {"current_date", CURRENT_DATE}, {"current_role", CURRENT_ROLE}, {"current_time", CURRENT_TIME}, diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y index e4bd74f38c..a8c0473e81 100644 --- a/src/interfaces/ecpg/preproc/preproc.y +++ b/src/interfaces/ecpg/preproc/preproc.y @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.345 2007/06/11 12:01:23 meskes Exp $ */ +/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.346 2007/06/12 07:55:56 meskes Exp $ */ /* Copyright comment */ %{ @@ -351,7 +351,7 @@ add_additional_variables(char *name, bool insert) /* special embedded SQL token */ %token SQL_ALLOCATE SQL_AUTOCOMMIT SQL_BOOL SQL_BREAK SQL_CALL SQL_CARDINALITY SQL_CONNECT - SQL_CONTINUE SQL_COUNT SQL_CURRENT SQL_DATA + SQL_CONTINUE SQL_COUNT SQL_DATA SQL_DATETIME_INTERVAL_CODE SQL_DATETIME_INTERVAL_PRECISION SQL_DESCRIBE SQL_DESCRIPTOR SQL_DISCONNECT SQL_FOUND @@ -387,8 +387,8 @@ add_additional_variables(char *name, bool insert) CLUSTER COALESCE COLLATE COLUMN COMMENT COMMIT COMMITTED CONCURRENTLY CONNECTION CONSTRAINT CONSTRAINTS CONTENT_P CONVERSION_P CONVERT COPY COST CREATE CREATEDB - CREATEROLE CREATEUSER CROSS CSV CURRENT_DATE CURRENT_ROLE CURRENT_TIME - CURRENT_TIMESTAMP CURRENT_USER CURSOR CYCLE + CREATEROLE CREATEUSER CROSS CSV CURRENT_P CURRENT_DATE CURRENT_ROLE + CURRENT_TIME CURRENT_TIMESTAMP CURRENT_USER CURSOR CYCLE DATABASE DAY_P DEALLOCATE DEC DECIMAL_P DECLARE DEFAULT DEFAULTS DEFERRABLE DEFERRED DEFINER DELETE_P DELIMITER DELIMITERS @@ -576,7 +576,7 @@ add_additional_variables(char *name, bool insert) %type select_limit CheckPointStmt ECPGColId old_aggr_list %type OptSchemaName OptSchemaEltList schema_stmt opt_drop_behavior %type handler_name any_name_list any_name opt_as insert_column_list -%type columnref values_clause AllConstVar +%type columnref values_clause AllConstVar where_or_current_clause %type insert_column_item DropRuleStmt ctext_expr %type createfunc_opt_item set_rest var_list_or_default alter_rel_cmd %type CreateFunctionStmt createfunc_opt_list func_table @@ -3274,7 +3274,7 @@ returning_clause: RETURNING target_list { $$ = cat2_str(make_str("returning"), * *****************************************************************************/ -DeleteStmt: DELETE_P FROM relation_expr_opt_alias using_clause where_clause returning_clause +DeleteStmt: DELETE_P FROM relation_expr_opt_alias using_clause where_or_current_clause returning_clause { $$ = cat_str(5, make_str("delete from"), $3, $4, $5, $6); } ; @@ -3316,7 +3316,7 @@ opt_nowait: NOWAIT { $$ = make_str("nowait"); } UpdateStmt: UPDATE relation_expr_opt_alias SET set_clause_list from_clause - where_clause + where_or_current_clause returning_clause {$$ = cat_str(7, make_str("update"), $2, make_str("set"), $4, $5, $6, $7); } ; @@ -3729,6 +3729,12 @@ where_clause: WHERE a_expr { $$ = cat2_str(make_str("where"), $2); } | /*EMPTY*/ { $$ = EMPTY; /* no qualifiers */ } ; +where_or_current_clause: WHERE a_expr { $$ = cat2_str(make_str("where"), $2); } + | WHERE CURRENT_P OF name { $$ = cat2_str(make_str("where current of"), $4); } + | WHERE CURRENT_P OF PARAM { $$ = make_str("where current of param"); } + | /*EMPTY*/ { $$ = EMPTY; /* no qualifiers */ } + ; + TableFuncElementList: TableFuncElement { $$ = $1; } | TableFuncElementList ',' TableFuncElement @@ -5721,7 +5727,7 @@ ECPGDisconnect: SQL_DISCONNECT dis_name { $$ = $2; } ; dis_name: connection_object { $$ = $1; } - | SQL_CURRENT { $$ = make_str("\"CURRENT\""); } + | CURRENT_P { $$ = make_str("\"CURRENT\""); } | ALL { $$ = make_str("\"ALL\""); } | /* EMPTY */ { $$ = make_str("\"CURRENT\""); } ; @@ -6443,6 +6449,7 @@ ECPGunreserved_con: ABORT_P { $$ = make_str("abort"); } | CREATEROLE { $$ = make_str("createrole"); } | CREATEUSER { $$ = make_str("createuser"); } | CSV { $$ = make_str("csv"); } + | CURRENT_P { $$ = make_str("current"); } | CURSOR { $$ = make_str("cursor"); } | CYCLE { $$ = make_str("cycle"); } | DATABASE { $$ = make_str("database"); }