Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
34fd62c5
Commit
34fd62c5
authored
Mar 02, 1997
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove case-sensitive identifiers. Thanks for Dan McGuirk for a reversal patch.
parent
a3a956bf
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
126 deletions
+35
-126
src/backend/parser/analyze.c
src/backend/parser/analyze.c
+1
-51
src/backend/parser/catalog_utils.c
src/backend/parser/catalog_utils.c
+1
-49
src/backend/parser/keywords.c
src/backend/parser/keywords.c
+4
-3
src/backend/parser/scan.l
src/backend/parser/scan.l
+7
-1
src/test/regress/expected.input
src/test/regress/expected.input
+22
-22
No files found.
src/backend/parser/analyze.c
View file @
34fd62c5
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.2
1 1997/02/07 16:22:50
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.2
2 1997/03/02 01:02:48
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -80,9 +80,6 @@ static void AddAggToParseState(ParseState *pstate, Aggreg *aggreg);
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
);
/*****************************************************************************
*
*****************************************************************************/
...
...
@@ -1904,32 +1901,6 @@ ParseComplexProjection(ParseState *pstate,
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
)
{
...
...
@@ -2048,27 +2019,6 @@ 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
;
}
}
}
}
}
...
...
src/backend/parser/catalog_utils.c
View file @
34fd62c5
...
...
@@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.1
6 1997/02/07 16:23:08
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.1
7 1997/03/02 01:03:00
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -110,9 +110,6 @@ static Oid **argtype_inherit(int nargs, Oid *oid_array);
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
...
...
@@ -1017,32 +1014,6 @@ func_select_candidate(int nargs,
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
,
...
...
@@ -1138,24 +1109,6 @@ func_get_detail(char *funcname,
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'
)
...
...
@@ -1163,7 +1116,6 @@ func_get_detail(char *funcname,
funcname
);
}
func_error
(
"func_get_detail"
,
funcname
,
nargs
,
oid_array
);
}
}
else
{
pform
=
(
Form_pg_proc
)
GETSTRUCT
(
ftup
);
*
funcid
=
ftup
->
t_oid
;
...
...
src/backend/parser/keywords.c
View file @
34fd62c5
...
...
@@ -7,7 +7,7 @@
*
*
* 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)
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
)
...
...
@@ -167,6 +166,7 @@ ScanKeywordLookup(char *text)
return
(
NULL
);
}
#ifdef NOT_USED
char
*
AtomValueGetString
(
int
atomval
)
{
...
...
@@ -182,3 +182,4 @@ AtomValueGetString(int atomval)
elog
(
WARN
,
"AtomGetString called with bogus atom # : %d"
,
atomval
);
return
(
NULL
);
}
#endif
src/backend/parser/scan.l
View file @
34fd62c5
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.1
1 1997/02/28 13:25
:16 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.1
2 1997/03/02 01:03
:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -164,8 +164,13 @@ other .
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);
...
...
@@ -209,6 +214,7 @@ init_io()
}
#if !defined(FLEX_SCANNER)
/* get lex input from a string instead of from stdin */
int
...
...
src/test/regress/expected.input
View file @
34fd62c5
...
...
@@ -6699,38 +6699,26 @@ QUERY: SELECT user_relns() AS user_relns
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
...
...
@@ -6739,6 +6727,8 @@ emp
equipment_r
f_star
fast_emp4000
float4_tbl
float8_tbl
hash_c16_heap
hash_f8_heap
hash_i4_heap
...
...
@@ -6746,12 +6736,21 @@ hash_txt_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
...
...
@@ -6760,6 +6759,7 @@ stud_emp
student
tenk1
tenk2
tinterval_tbl
toyemp
xacttest
(63 rows)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment