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

Commit2a54525

Browse files
author
Michael Meskes
committed
- Allowed some C keywords to be used as SQL column names.
1 parenta05977e commit2a54525

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

‎src/interfaces/ecpg/ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1739,5 +1739,6 @@ Mon Jan 26 21:57:14 CET 2004
17391739
Sun Feb 15 14:44:14 CET 2004
17401740

17411741
- Added missing braces to array parsing.
1742+
- Allowed some C keywords to be used as SQL column names.
17421743
- Set ecpg version to 3.1.1.
17431744

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.272 2004/02/1513:48:54 meskes Exp $*/
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.273 2004/02/1515:38:20 meskes Exp $*/
22

33
/* Copyright comment*/
44
%{
@@ -528,7 +528,7 @@ add_additional_variables(char *name, bool insert)
528528
%type<str>user_nameopt_userchar_variableora_useridentopt_reference
529529
%type<str>var_type_declarationsquoted_ident_stringvarECPGKeywords_rest
530530
%type<str>db_prefixserveropt_optionsopt_connection_namec_list
531-
%type<str>ECPGSetConnectionECPGTypedefc_argsECPGKeywords
531+
%type<str>ECPGSetConnectionECPGTypedefc_argsECPGKeywordsECPGCKeywords
532532
%type<str>enum_typecivarcivarindECPGCursorStmtECPGDeallocate
533533
%type<str>ECPGFreeECPGDeclareECPGVaropt_atenum_definition
534534
%type<str>struct_union_types_struct_unionvt_declarationsexecute_rest
@@ -5747,6 +5747,7 @@ ColId:ident{ $$ = $1; }
57475747
|unreserved_keyword{$$ =$1; }
57485748
|col_name_keyword{$$ =$1; }
57495749
|ECPGKeywords{$$ =$1; }
5750+
|ECPGCKeywords{$$ =$1; }
57505751
|CHAR_P{$$ = make_str("char"); }
57515752
;
57525753

@@ -5756,6 +5757,7 @@ type_name:ident{ $$ = $1; }
57565757
|unreserved_keyword{$$ =$1; }
57575758
|ECPGKeywords{$$ =$1; }
57585759
|ECPGTypeName{$$ =$1; }
5760+
|ECPGCKeywords{$$ =$1; }
57595761
;
57605762

57615763
/* Function identifier --- names that can be function names.
@@ -5764,6 +5766,7 @@ function_name:ident{ $$ = $1; }
57645766
|unreserved_keyword{$$ =$1; }
57655767
|func_name_keyword{$$ =$1; }
57665768
|ECPGKeywords{$$ =$1; }
5769+
|ECPGCKeywords{$$ =$1; }
57675770
;
57685771

57695772
/* Column label --- allowed labels in "AS" clauses.
@@ -5775,6 +5778,7 @@ ColLabel: ECPGColLabel{ $$ = $1; }
57755778
|INPUT_P{$$ = make_str("input"); }
57765779
|INT_P{$$ = make_str("int"); }
57775780
|UNION{$$ = make_str("union"); }
5781+
|ECPGCKeywords{$$ =$1; }
57785782
;
57795783

57805784
ECPGColLabelCommon:ident {$$ =$1; }
@@ -5789,6 +5793,14 @@ ECPGColLabel: ECPGColLabelCommon{ $$ = $1; }
57895793
|ECPGKeywords_rest{$$ =$1; }
57905794
;
57915795

5796+
ECPGCKeywords:S_AUTO{$$ = make_str("auto"); }
5797+
|S_CONST{$$ = make_str("const"); }
5798+
|S_EXTERN{$$ = make_str("extern"); }
5799+
|S_REGISTER{$$ = make_str("register"); }
5800+
|S_STATIC{$$ = make_str("static"); }
5801+
|S_TYPEDEF{$$ = make_str("typedef"); }
5802+
;
5803+
57925804
/*
57935805
* Keyword classification lists. Generally, every keyword present in
57945806
* the Postgres grammar should appear in exactly one of these lists.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp