*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
static void finalizeAggregates(ParseState *pstate, Query *qry);
static void parseCheckAggregates(ParseState *pstate, Query *qry);
-static bool is_lowercase(char *string);
-static void make_lowercase(char *string);
-
/*****************************************************************************
*
*****************************************************************************/
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 *
ParseFunc(ParseState *pstate, char *funcname, List *fargs, int *curr_resno)
{
AddAggToParseState(pstate, 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;
- }
- }
}
}
}
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
static Oid **genxprod(InhPaths *arginh, int nargs);
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,
* returns true if it is. By using this call before calling
* get_id_type or get_id_typname, more meaningful error messages
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
func_get_detail(char *funcname,
int nargs,
if (!HeapTupleIsValid(ftup)) {
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) {
tp = get_id_type(oid_array[0]);
if (typetypetype(tp) == 'c')
funcname);
}
func_error("func_get_detail", funcname, nargs, oid_array);
- }
} else {
pform = (Form_pg_proc) GETSTRUCT(ftup);
*funcid = ftup->t_oid;
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
while (low <= high) {
middle = low + (high - low) / 2;
- /* keywords case-insensitive (for SQL) -- ay 8/94 */
- difference = strcasecmp(middle->name, text);
+ difference = strcmp(middle->name, text);
if (difference == 0)
return (middle);
else if (difference < 0)
return (NULL);
}
+#ifdef NOT_USED
char*
AtomValueGetString(int atomval)
{
elog(WARN,"AtomGetString called with bogus atom # : %d", atomval );
return(NULL);
}
+#endif
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
return (SCONST);
}
{identifier} {
+ int i;
ScanKeyword *keyword;
+ for(i = 0; i < strlen(yytext); i++)
+ if (isupper(yytext[i]))
+ yytext[i] = tolower(yytext[i]);
+
keyword = ScanKeywordLookup((char*)yytext);
if (keyword != NULL) {
return (keyword->value);
}
+
#if !defined(FLEX_SCANNER)
/* get lex input from a string instead of from stdin */
int
ORDER BY 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_star
+abstime_tbl
aggtest
arrtest
b_star
+booltbl1
+booltbl2
+box_tbl
+bprime
bt_c16_heap
bt_f8_heap
bt_i4_heap
bt_txt_heap
c_star
+char16_tbl
+char2_tbl
+char4_tbl
+char8_tbl
+char_tbl
city
d_star
dept
equipment_r
f_star
fast_emp4000
+float4_tbl
+float8_tbl
hash_c16_heap
hash_f8_heap
hash_i4_heap
hobbies_r
iexit
ihighway
+int2_tbl
+int4_tbl
iportaltest
+oid_tbl
+oidint2_tbl
+oidint4_tbl
+oidname_tbl
onek
onek2
person
+point_tbl
+polygon_tbl
ramp
real_city
+reltime_tbl
road
shighway
slow_emp4000
student
tenk1
tenk2
+tinterval_tbl
toyemp
xacttest
(63 rows)