Commit 34fd62c5 authored by Bruce Momjian's avatar Bruce Momjian

Remove case-sensitive identifiers. Thanks for Dan McGuirk for a reversal patch.

parent a3a956bf
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.21 1997/02/07 16:22:50 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.22 1997/03/02 01:02:48 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -80,9 +80,6 @@ static void AddAggToParseState(ParseState *pstate, Aggreg *aggreg); ...@@ -80,9 +80,6 @@ static void AddAggToParseState(ParseState *pstate, Aggreg *aggreg);
static void finalizeAggregates(ParseState *pstate, Query *qry); static void finalizeAggregates(ParseState *pstate, Query *qry);
static void parseCheckAggregates(ParseState *pstate, Query *qry); static void parseCheckAggregates(ParseState *pstate, Query *qry);
static bool is_lowercase(char *string);
static void make_lowercase(char *string);
/***************************************************************************** /*****************************************************************************
* *
*****************************************************************************/ *****************************************************************************/
...@@ -1904,32 +1901,6 @@ ParseComplexProjection(ParseState *pstate, ...@@ -1904,32 +1901,6 @@ ParseComplexProjection(ParseState *pstate,
return NULL; return NULL;
} }
static
bool is_lowercase(char *string)
{
int i;
for(i = 0; i < strlen(string); i++) {
if(string[i] >= 'A' && string[i] <= 'Z') {
return false;
}
}
return true;
}
static
void make_lowercase(char *string)
{
int i;
for(i = 0; i < strlen(string); i++) {
if(string[i] >= 'A' && string[i] <= 'Z') {
string[i] = (string[i] - 'A') + 'a';
}
}
}
static Node * static Node *
ParseFunc(ParseState *pstate, char *funcname, List *fargs, int *curr_resno) ParseFunc(ParseState *pstate, char *funcname, List *fargs, int *curr_resno)
{ {
...@@ -2048,27 +2019,6 @@ ParseFunc(ParseState *pstate, char *funcname, List *fargs, int *curr_resno) ...@@ -2048,27 +2019,6 @@ ParseFunc(ParseState *pstate, char *funcname, List *fargs, int *curr_resno)
AddAggToParseState(pstate, aggreg); AddAggToParseState(pstate, aggreg);
return (Node*)aggreg; return (Node*)aggreg;
} else {
/* try one more time with lowercase --djm 8/17/96 */
if(!is_lowercase(funcname)) {
char *lowercase_funcname = pstrdup(funcname);
make_lowercase(lowercase_funcname);
if (strcmp(lowercase_funcname, "count") == 0)
basetype = 0;
else
basetype = exprType(lfirst(fargs));
if (SearchSysCacheTuple(AGGNAME,
PointerGetDatum(lowercase_funcname),
ObjectIdGetDatum(basetype),
0, 0)) {
Aggreg *aggreg = ParseAgg(lowercase_funcname,
basetype, lfirst(fargs));
AddAggToParseState(pstate, aggreg);
return (Node*)aggreg;
}
}
} }
} }
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.16 1997/02/07 16:23:08 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.17 1997/03/02 01:03:00 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -110,9 +110,6 @@ static Oid **argtype_inherit(int nargs, Oid *oid_array); ...@@ -110,9 +110,6 @@ static Oid **argtype_inherit(int nargs, Oid *oid_array);
static Oid **genxprod(InhPaths *arginh, int nargs); static Oid **genxprod(InhPaths *arginh, int nargs);
static int findsupers(Oid relid, Oid **supervec); static int findsupers(Oid relid, Oid **supervec);
static bool is_lowercase(char *string);
static void make_lowercase(char *string);
/* check to see if a type id is valid, /* check to see if a type id is valid,
* returns true if it is. By using this call before calling * returns true if it is. By using this call before calling
* get_id_type or get_id_typname, more meaningful error messages * get_id_type or get_id_typname, more meaningful error messages
...@@ -1017,32 +1014,6 @@ func_select_candidate(int nargs, ...@@ -1017,32 +1014,6 @@ func_select_candidate(int nargs,
return (NULL); return (NULL);
} }
static
bool is_lowercase(char *string)
{
int i;
for(i = 0; i < strlen(string); i++) {
if(string[i] >= 'A' && string[i] <= 'Z') {
return false;
}
}
return true;
}
static
void make_lowercase(char *string)
{
int i;
for(i = 0; i < strlen(string); i++) {
if(string[i] >= 'A' && string[i] <= 'Z') {
string[i] = (string[i] - 'A') + 'a';
}
}
}
bool bool
func_get_detail(char *funcname, func_get_detail(char *funcname,
int nargs, int nargs,
...@@ -1138,24 +1109,6 @@ func_get_detail(char *funcname, ...@@ -1138,24 +1109,6 @@ func_get_detail(char *funcname,
if (!HeapTupleIsValid(ftup)) { if (!HeapTupleIsValid(ftup)) {
Type tp; Type tp;
/*
* everything else has failed--try converting the function
* name to lowercase, and do everything one more time
* (if it's not already lowercase). so ODBC applications
* that expect uppercase names to work can work. --djm 8/17/96
*/
if(!is_lowercase(funcname)) {
char *lowercase_funcname = strdup(funcname);
bool result;
make_lowercase(lowercase_funcname);
result = func_get_detail(lowercase_funcname, nargs, oid_array,
funcid, rettype, retset,
true_typeids);
free(lowercase_funcname);
return result;
} else {
if (nargs == 1) { if (nargs == 1) {
tp = get_id_type(oid_array[0]); tp = get_id_type(oid_array[0]);
if (typetypetype(tp) == 'c') if (typetypetype(tp) == 'c')
...@@ -1163,7 +1116,6 @@ func_get_detail(char *funcname, ...@@ -1163,7 +1116,6 @@ func_get_detail(char *funcname,
funcname); funcname);
} }
func_error("func_get_detail", funcname, nargs, oid_array); func_error("func_get_detail", funcname, nargs, oid_array);
}
} else { } else {
pform = (Form_pg_proc) GETSTRUCT(ftup); pform = (Form_pg_proc) GETSTRUCT(ftup);
*funcid = ftup->t_oid; *funcid = ftup->t_oid;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.6 1997/01/13 03:44:25 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.7 1997/03/02 01:03:07 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -154,8 +154,7 @@ ScanKeywordLookup(char *text) ...@@ -154,8 +154,7 @@ ScanKeywordLookup(char *text)
while (low <= high) { while (low <= high) {
middle = low + (high - low) / 2; middle = low + (high - low) / 2;
/* keywords case-insensitive (for SQL) -- ay 8/94 */ difference = strcmp(middle->name, text);
difference = strcasecmp(middle->name, text);
if (difference == 0) if (difference == 0)
return (middle); return (middle);
else if (difference < 0) else if (difference < 0)
...@@ -167,6 +166,7 @@ ScanKeywordLookup(char *text) ...@@ -167,6 +166,7 @@ ScanKeywordLookup(char *text)
return (NULL); return (NULL);
} }
#ifdef NOT_USED
char* char*
AtomValueGetString(int atomval) AtomValueGetString(int atomval)
{ {
...@@ -182,3 +182,4 @@ AtomValueGetString(int atomval) ...@@ -182,3 +182,4 @@ AtomValueGetString(int atomval)
elog(WARN,"AtomGetString called with bogus atom # : %d", atomval ); elog(WARN,"AtomGetString called with bogus atom # : %d", atomval );
return(NULL); return(NULL);
} }
#endif
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.11 1997/02/28 13:25:16 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.12 1997/03/02 01:03:16 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -164,8 +164,13 @@ other . ...@@ -164,8 +164,13 @@ other .
return (SCONST); return (SCONST);
} }
{identifier} { {identifier} {
int i;
ScanKeyword *keyword; ScanKeyword *keyword;
for(i = 0; i < strlen(yytext); i++)
if (isupper(yytext[i]))
yytext[i] = tolower(yytext[i]);
keyword = ScanKeywordLookup((char*)yytext); keyword = ScanKeywordLookup((char*)yytext);
if (keyword != NULL) { if (keyword != NULL) {
return (keyword->value); return (keyword->value);
...@@ -209,6 +214,7 @@ init_io() ...@@ -209,6 +214,7 @@ init_io()
} }
#if !defined(FLEX_SCANNER) #if !defined(FLEX_SCANNER)
/* get lex input from a string instead of from stdin */ /* get lex input from a string instead of from stdin */
int int
......
...@@ -6699,38 +6699,26 @@ QUERY: SELECT user_relns() AS user_relns ...@@ -6699,38 +6699,26 @@ QUERY: SELECT user_relns() AS user_relns
ORDER BY user_relns; ORDER BY user_relns;
user_relns user_relns
------------- -------------
ABSTIME_TBL
BOOLTBL1
BOOLTBL2
BOX_TBL
Bprime
CHAR16_TBL
CHAR2_TBL
CHAR4_TBL
CHAR8_TBL
CHAR_TBL
FLOAT4_TBL
FLOAT8_TBL
INT2_TBL
INT4_TBL
OIDINT2_TBL
OIDINT4_TBL
OIDNAME_TBL
OID_TBL
POINT_TBL
POLYGON_TBL
RELTIME_TBL
TINTERVAL_TBL
a,775132 a,775132
a_star a_star
abstime_tbl
aggtest aggtest
arrtest arrtest
b_star b_star
booltbl1
booltbl2
box_tbl
bprime
bt_c16_heap bt_c16_heap
bt_f8_heap bt_f8_heap
bt_i4_heap bt_i4_heap
bt_txt_heap bt_txt_heap
c_star c_star
char16_tbl
char2_tbl
char4_tbl
char8_tbl
char_tbl
city city
d_star d_star
dept dept
...@@ -6739,6 +6727,8 @@ emp ...@@ -6739,6 +6727,8 @@ emp
equipment_r equipment_r
f_star f_star
fast_emp4000 fast_emp4000
float4_tbl
float8_tbl
hash_c16_heap hash_c16_heap
hash_f8_heap hash_f8_heap
hash_i4_heap hash_i4_heap
...@@ -6746,12 +6736,21 @@ hash_txt_heap ...@@ -6746,12 +6736,21 @@ hash_txt_heap
hobbies_r hobbies_r
iexit iexit
ihighway ihighway
int2_tbl
int4_tbl
iportaltest iportaltest
oid_tbl
oidint2_tbl
oidint4_tbl
oidname_tbl
onek onek
onek2 onek2
person person
point_tbl
polygon_tbl
ramp ramp
real_city real_city
reltime_tbl
road road
shighway shighway
slow_emp4000 slow_emp4000
...@@ -6760,6 +6759,7 @@ stud_emp ...@@ -6760,6 +6759,7 @@ stud_emp
student student
tenk1 tenk1
tenk2 tenk2
tinterval_tbl
toyemp toyemp
xacttest xacttest
(63 rows) (63 rows)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment