]> granicus.if.org Git - postgresql/commitdiff
Synced parser and keyword list.
authorMichael Meskes <meskes@postgresql.org>
Tue, 12 Jun 2007 07:55:56 +0000 (07:55 +0000)
committerMichael Meskes <meskes@postgresql.org>
Tue, 12 Jun 2007 07:55:56 +0000 (07:55 +0000)
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/preproc/ecpg_keywords.c
src/interfaces/ecpg/preproc/keywords.c
src/interfaces/ecpg/preproc/preproc.y

index 28aaca24e672ebf3b5e47c85d6defe2cd3e28fe5..06c0414e15f14416d20743eb23868c3a916c04ab 100644 (file)
@@ -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 <harada.toshi@oss.ntt.co.jp>.
-       - 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.
index 71df4ad1ba1a3232b6ec0192b905065c131be31f..3244880151b138124a874e98e685babc25d078e5 100644 (file)
@@ -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},
index beff5805bc41f93607b8f5418486eb659a1209e9..f2f3094e06c090922ee284ba52aa218684e7b1d3 100644 (file)
@@ -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},
index e4bd74f38c401ab7c335f409db19ffcf378f4b66..a8c0473e81e0fbf4eb9880e6358b4bf813c091a1 100644 (file)
@@ -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  <str>   select_limit CheckPointStmt ECPGColId old_aggr_list
 %type  <str>   OptSchemaName OptSchemaEltList schema_stmt opt_drop_behavior
 %type  <str>   handler_name any_name_list any_name opt_as insert_column_list
-%type  <str>   columnref values_clause AllConstVar
+%type  <str>   columnref values_clause AllConstVar where_or_current_clause
 %type  <str>   insert_column_item DropRuleStmt ctext_expr 
 %type  <str>   createfunc_opt_item set_rest var_list_or_default alter_rel_cmd
 %type  <str>   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"); }