|
1 | | -/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.312 2005/11/27 01:22:23 tgl Exp $*/ |
| 1 | +/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.313 2005/12/02 15:03:57 meskes Exp $*/ |
2 | 2 |
|
3 | 3 | /* Copyright comment*/ |
4 | 4 | %{ |
@@ -324,7 +324,7 @@ add_additional_variables(char *name, bool insert) |
324 | 324 |
|
325 | 325 | /* special embedded SQL token*/ |
326 | 326 | %tokenSQL_ALLOCATESQL_AUTOCOMMITSQL_BOOLSQL_BREAK |
327 | | -SQL_CALLSQL_CARDINALITYSQL_CONNECTSQL_CONNECTION |
| 327 | +SQL_CALLSQL_CARDINALITYSQL_CONNECT |
328 | 328 | SQL_CONTINUESQL_COUNTSQL_CURRENTSQL_DATA |
329 | 329 | SQL_DATETIME_INTERVAL_CODE |
330 | 330 | SQL_DATETIME_INTERVAL_PRECISIONSQL_DESCRIBE |
@@ -506,7 +506,7 @@ add_additional_variables(char *name, bool insert) |
506 | 506 | %type<str>opt_insteadeventRuleActionListopt_usingCreateAssertStmt |
507 | 507 | %type<str>RuleActionStmtOrEmptyRuleActionMultifunc_asreindex_type |
508 | 508 | %type<str>RuleStmtopt_columnoper_argtypesNumConstvar_name |
509 | | -%type<str>MathOpRemoveFuncStmtaggr_argtype |
| 509 | +%type<str>MathOpRemoveFuncStmtaggr_argtypeECPGunreserved_con |
510 | 510 | %type<str>RemoveAggrStmtopt_proceduralselect_no_parensCreateCastStmt |
511 | 511 | %type<str>RemoveOperStmtRenameStmtall_Opopt_trustedopt_lancompiler |
512 | 512 | %type<str>VariableSetStmtvar_valuezone_valueVariableShowStmt |
@@ -537,7 +537,7 @@ add_additional_variables(char *name, bool insert) |
537 | 537 | %type<str>CreateGroupStmtAlterGroupStmtDropGroupStmtkey_delete |
538 | 538 | %type<str>opt_forcekey_updateCreateSchemaStmtPosIntStringConst |
539 | 539 | %type<str>IntConstPosIntConstgrantee_listfunc_typeopt_or_replace |
540 | | -%type<str>select_limitCheckPointStmt |
| 540 | +%type<str>select_limitCheckPointStmtECPGColId |
541 | 541 | %type<str>OptSchemaNameOptSchemaEltListschema_stmtopt_drop_behavior |
542 | 542 | %type<str>handler_nameany_name_listany_nameopt_asinsert_column_list |
543 | 543 | %type<str>columnreffunction_nameinsert_target_elAllConstVar |
@@ -1117,7 +1117,7 @@ set_rest:var_name TO var_list_or_default |
1117 | 1117 | {$$ = make_str("session authorization default"); } |
1118 | 1118 | ; |
1119 | 1119 |
|
1120 | | -var_name:ColId{$$ =$1; } |
| 1120 | +var_name:ECPGColId{$$ =$1; } |
1121 | 1121 | |var_name'.'ColId{$$ = cat_str(3,$1, make_str("."),$3); } |
1122 | 1122 | ; |
1123 | 1123 |
|
@@ -5649,9 +5649,9 @@ on_off: ON{ $$ = make_str("on"); } |
5649 | 5649 | * set the actual connection, this needs a differnet handling as the other |
5650 | 5650 | * set commands |
5651 | 5651 | */ |
5652 | | -ECPGSetConnection:SETSQL_CONNECTIONTOconnection_object {$$ =$4; } |
5653 | | -|SETSQL_CONNECTION'='connection_object {$$ =$4; } |
5654 | | -|SETSQL_CONNECTIONconnection_object {$$ =$3; } |
| 5652 | +ECPGSetConnection:SETCONNECTIONTOconnection_object {$$ =$4; } |
| 5653 | +|SETCONNECTION'='connection_object {$$ =$4; } |
| 5654 | +|SETCONNECTIONconnection_object {$$ =$3; } |
5655 | 5655 | ; |
5656 | 5656 |
|
5657 | 5657 | /* |
@@ -5936,6 +5936,14 @@ symbol: ColLabel{ $$ = $1; } |
5936 | 5936 | * is chosen in part to make keywords acceptable as names wherever possible. |
5937 | 5937 | */ |
5938 | 5938 |
|
| 5939 | +ECPGColId:ident{$$ =$1; } |
| 5940 | +|ECPGunreserved_interval{$$ =$1; } |
| 5941 | +|ECPGunreserved_con{$$ =$1; } |
| 5942 | +|col_name_keyword{$$ =$1; } |
| 5943 | +|ECPGKeywords{$$ =$1; } |
| 5944 | +|ECPGCKeywords{$$ =$1; } |
| 5945 | +|CHAR_P{$$ = make_str("char"); } |
| 5946 | +; |
5939 | 5947 | /* Column identifier --- names that can be column, table, etc names. |
5940 | 5948 | */ |
5941 | 5949 | ColId:ident{$$ =$1; } |
@@ -6016,15 +6024,23 @@ ECPGCKeywords: S_AUTO{ $$ = make_str("auto"); } |
6016 | 6024 | */ |
6017 | 6025 | unreserved_keyword:ECPGunreserved_interval|ECPGunreserved; |
6018 | 6026 |
|
6019 | | -ECPGunreserved_interval:DAY_P{$$ = make_str("day"); } |
| 6027 | +ECPGunreserved_interval:DAY_P{$$ = make_str("day"); } |
6020 | 6028 | |HOUR_P{$$ = make_str("hour"); } |
6021 | 6029 | |MINUTE_P{$$ = make_str("minute"); } |
6022 | 6030 | |MONTH_P{$$ = make_str("month"); } |
6023 | 6031 | |SECOND_P{$$ = make_str("second"); } |
6024 | 6032 | |YEAR_P{$$ = make_str("year"); } |
6025 | 6033 | ; |
6026 | 6034 |
|
6027 | | -ECPGunreserved:ABORT_P{$$ = make_str("abort"); } |
| 6035 | +/* The following symbol must be excluded from var_name but still included in ColId |
| 6036 | + to enable ecpg special postgresql variables with this name: |
| 6037 | + CONNECTION |
| 6038 | +*/ |
| 6039 | +ECPGunreserved:ECPGunreserved_con{$$ =$1; } |
| 6040 | +|CONNECTION{$$ = make_str("connection"); } |
| 6041 | +; |
| 6042 | + |
| 6043 | +ECPGunreserved_con:ABORT_P{$$ = make_str("abort"); } |
6028 | 6044 | |ABSOLUTE_P{$$ = make_str("absolute"); } |
6029 | 6045 | |ACCESS{$$ = make_str("access"); } |
6030 | 6046 | |ACTION{$$ = make_str("action"); } |
@@ -6052,7 +6068,7 @@ ECPGunreserved: ABORT_P{ $$ = make_str("abort"); } |
6052 | 6068 | |COMMENT{$$ = make_str("comment"); } |
6053 | 6069 | |COMMIT{$$ = make_str("commit"); } |
6054 | 6070 | |COMMITTED{$$ = make_str("committed"); } |
6055 | | -|CONNECTION{$$ = make_str("connection"); } |
| 6071 | +/*| CONNECTION{ $$ = make_str("connection"); }*/ |
6056 | 6072 | |CONSTRAINTS{$$ = make_str("constraints"); } |
6057 | 6073 | |CONVERSION_P{$$ = make_str("conversion"); } |
6058 | 6074 | |COPY{$$ = make_str("copy"); } |
|