Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5106aff

Browse files
author
Michael Meskes
committed
Added special handling of CONNECTION variable that is used by ECPG instead of given to the backend.
1 parent9322a04 commit5106aff

File tree

3 files changed

+33
-13
lines changed

3 files changed

+33
-13
lines changed

‎src/interfaces/ecpg/ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1957,6 +1957,11 @@ Wed Nov 30 12:49:13 CET 2005
19571957
- Made several variables "const char *" instead of "char *" as
19581958
proposed by Qingqing Zhou <zhouqq@cs.toronto.edu>.
19591959
- Replaced all strdup() calls by ECPGstrdup().
1960+
1961+
Fri Dec 2 16:00:10 CET 2005
1962+
1963+
- Added special handling of CONNECTION variable that is used by ECPG
1964+
instead of given to the backend.
19601965
- Set ecpg library version to 5.2.
19611966
- Set ecpg version to 4.2.1.
19621967

‎src/interfaces/ecpg/preproc/ecpg_keywords.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* lexical token lookup for reserved words in postgres embedded SQL
55
*
66
* IDENTIFICATION
7-
* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg_keywords.c,v 1.31 2005/10/15 02:49:47 momjian Exp $
7+
* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg_keywords.c,v 1.32 2005/12/02 15:03:57 meskes Exp $
88
*
99
*-------------------------------------------------------------------------
1010
*/
@@ -31,7 +31,6 @@ static ScanKeyword ScanKeywords[] = {
3131
{"call",SQL_CALL},
3232
{"cardinality",SQL_CARDINALITY},
3333
{"connect",SQL_CONNECT},
34-
{"connection",SQL_CONNECTION},
3534
{"continue",SQL_CONTINUE},
3635
{"count",SQL_COUNT},
3736
{"current",SQL_CURRENT},

‎src/interfaces/ecpg/preproc/preproc.y

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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 $*/
22

33
/* Copyright comment*/
44
%{
@@ -324,7 +324,7 @@ add_additional_variables(char *name, bool insert)
324324

325325
/* special embedded SQL token*/
326326
%tokenSQL_ALLOCATESQL_AUTOCOMMITSQL_BOOLSQL_BREAK
327-
SQL_CALLSQL_CARDINALITYSQL_CONNECTSQL_CONNECTION
327+
SQL_CALLSQL_CARDINALITYSQL_CONNECT
328328
SQL_CONTINUESQL_COUNTSQL_CURRENTSQL_DATA
329329
SQL_DATETIME_INTERVAL_CODE
330330
SQL_DATETIME_INTERVAL_PRECISIONSQL_DESCRIBE
@@ -506,7 +506,7 @@ add_additional_variables(char *name, bool insert)
506506
%type<str>opt_insteadeventRuleActionListopt_usingCreateAssertStmt
507507
%type<str>RuleActionStmtOrEmptyRuleActionMultifunc_asreindex_type
508508
%type<str>RuleStmtopt_columnoper_argtypesNumConstvar_name
509-
%type<str>MathOpRemoveFuncStmtaggr_argtype
509+
%type<str>MathOpRemoveFuncStmtaggr_argtypeECPGunreserved_con
510510
%type<str>RemoveAggrStmtopt_proceduralselect_no_parensCreateCastStmt
511511
%type<str>RemoveOperStmtRenameStmtall_Opopt_trustedopt_lancompiler
512512
%type<str>VariableSetStmtvar_valuezone_valueVariableShowStmt
@@ -537,7 +537,7 @@ add_additional_variables(char *name, bool insert)
537537
%type<str>CreateGroupStmtAlterGroupStmtDropGroupStmtkey_delete
538538
%type<str>opt_forcekey_updateCreateSchemaStmtPosIntStringConst
539539
%type<str>IntConstPosIntConstgrantee_listfunc_typeopt_or_replace
540-
%type<str>select_limitCheckPointStmt
540+
%type<str>select_limitCheckPointStmtECPGColId
541541
%type<str>OptSchemaNameOptSchemaEltListschema_stmtopt_drop_behavior
542542
%type<str>handler_nameany_name_listany_nameopt_asinsert_column_list
543543
%type<str>columnreffunction_nameinsert_target_elAllConstVar
@@ -1117,7 +1117,7 @@ set_rest:var_name TO var_list_or_default
11171117
{$$ = make_str("session authorization default"); }
11181118
;
11191119

1120-
var_name:ColId{$$ =$1; }
1120+
var_name:ECPGColId{$$ =$1; }
11211121
|var_name'.'ColId{$$ = cat_str(3,$1, make_str("."),$3); }
11221122
;
11231123

@@ -5649,9 +5649,9 @@ on_off: ON{ $$ = make_str("on"); }
56495649
* set the actual connection, this needs a differnet handling as the other
56505650
* set commands
56515651
*/
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; }
56555655
;
56565656

56575657
/*
@@ -5936,6 +5936,14 @@ symbol: ColLabel{ $$ = $1; }
59365936
* is chosen in part to make keywords acceptable as names wherever possible.
59375937
*/
59385938

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+
;
59395947
/* Column identifier --- names that can be column, table, etc names.
59405948
*/
59415949
ColId:ident{$$ =$1; }
@@ -6016,15 +6024,23 @@ ECPGCKeywords: S_AUTO{ $$ = make_str("auto"); }
60166024
*/
60176025
unreserved_keyword:ECPGunreserved_interval|ECPGunreserved;
60186026

6019-
ECPGunreserved_interval:DAY_P{$$ = make_str("day"); }
6027+
ECPGunreserved_interval:DAY_P{$$ = make_str("day"); }
60206028
|HOUR_P{$$ = make_str("hour"); }
60216029
|MINUTE_P{$$ = make_str("minute"); }
60226030
|MONTH_P{$$ = make_str("month"); }
60236031
|SECOND_P{$$ = make_str("second"); }
60246032
|YEAR_P{$$ = make_str("year"); }
60256033
;
60266034

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"); }
60286044
|ABSOLUTE_P{$$ = make_str("absolute"); }
60296045
|ACCESS{$$ = make_str("access"); }
60306046
|ACTION{$$ = make_str("action"); }
@@ -6052,7 +6068,7 @@ ECPGunreserved: ABORT_P{ $$ = make_str("abort"); }
60526068
|COMMENT{$$ = make_str("comment"); }
60536069
|COMMIT{$$ = make_str("commit"); }
60546070
|COMMITTED{$$ = make_str("committed"); }
6055-
|CONNECTION{$$ = make_str("connection"); }
6071+
/*| CONNECTION{ $$ = make_str("connection"); }*/
60566072
|CONSTRAINTS{$$ = make_str("constraints"); }
60576073
|CONVERSION_P{$$ = make_str("conversion"); }
60586074
|COPY{$$ = make_str("copy"); }

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp