- Allowed some C keywords to be used as SQL column names. This used to work in 7.3.*

This commit is contained in:
Michael Meskes 2004-02-15 15:40:54 +00:00
parent 67893da1c1
commit fe92ed8b78

View File

@ -1,4 +1,4 @@
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.263.2.7 2004/02/15 13:50:02 meskes Exp $ */
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.263.2.8 2004/02/15 15:40:54 meskes Exp $ */
/* Copyright comment */
%{
@ -528,7 +528,7 @@ add_additional_variables(char *name, bool insert)
%type <str> user_name opt_user char_variable ora_user ident opt_reference
%type <str> var_type_declarations quoted_ident_stringvar ECPGKeywords_rest
%type <str> db_prefix server opt_options opt_connection_name c_list
%type <str> ECPGSetConnection ECPGTypedef c_args ECPGKeywords
%type <str> ECPGSetConnection ECPGTypedef c_args ECPGKeywords ECPGCKeywords
%type <str> enum_type civar civarind ECPGCursorStmt ECPGDeallocate
%type <str> ECPGFree ECPGDeclare ECPGVar opt_at enum_definition
%type <str> struct_union_type s_struct_union vt_declarations execute_rest
@ -5745,6 +5745,7 @@ ColId: ident { $$ = $1; }
| unreserved_keyword { $$ = $1; }
| col_name_keyword { $$ = $1; }
| ECPGKeywords { $$ = $1; }
| ECPGCKeywords { $$ = $1; }
| CHAR_P { $$ = make_str("char"); }
;
@ -5754,6 +5755,7 @@ type_name: ident { $$ = $1; }
| unreserved_keyword { $$ = $1; }
| ECPGKeywords { $$ = $1; }
| ECPGTypeName { $$ = $1; }
| ECPGCKeywords { $$ = $1; }
;
/* Function identifier --- names that can be function names.
@ -5762,6 +5764,7 @@ function_name: ident { $$ = $1; }
| unreserved_keyword { $$ = $1; }
| func_name_keyword { $$ = $1; }
| ECPGKeywords { $$ = $1; }
| ECPGCKeywords { $$ = $1; }
;
/* Column label --- allowed labels in "AS" clauses.
@ -5773,6 +5776,7 @@ ColLabel: ECPGColLabel { $$ = $1; }
| INPUT_P { $$ = make_str("input"); }
| INT_P { $$ = make_str("int"); }
| UNION { $$ = make_str("union"); }
| ECPGCKeywords { $$ = $1; }
;
ECPGColLabelCommon: ident { $$ = $1; }
@ -5787,6 +5791,14 @@ ECPGColLabel: ECPGColLabelCommon { $$ = $1; }
| ECPGKeywords_rest { $$ = $1; }
;
ECPGCKeywords: S_AUTO { $$ = make_str("auto"); }
| S_CONST { $$ = make_str("const"); }
| S_EXTERN { $$ = make_str("extern"); }
| S_REGISTER { $$ = make_str("register"); }
| S_STATIC { $$ = make_str("static"); }
| S_TYPEDEF { $$ = make_str("typedef"); }
;
/*
* Keyword classification lists. Generally, every keyword present in
* the Postgres grammar should appear in exactly one of these lists.