summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-01-31 00:32:00 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-01-31 00:32:00 +0000
commitbb0c948bb0d1cd0d5749a6f212b96fa4041050b1 (patch)
treee4211eab784215d459312b974f6ddb63aa1f8a72
parent5c508b7da142d7ed5e3d41d087993571741f81d1 (diff)
Handle mixed-case names properly in plpgsql_parse_tripwordtype.
From Neil Conway.
-rw-r--r--src/pl/plpgsql/src/pl_comp.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/pl/plpgsql/src/pl_comp.c b/src/pl/plpgsql/src/pl_comp.c
index 56c5ca3e70b..a2e116212bc 100644
--- a/src/pl/plpgsql/src/pl_comp.c
+++ b/src/pl/plpgsql/src/pl_comp.c
@@ -3,7 +3,7 @@
* procedural language
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.53 2002/09/21 18:39:26 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.53.2.1 2003/01/31 00:32:00 tgl Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
@@ -1109,6 +1109,7 @@ plpgsql_parse_tripwordtype(char *word)
Form_pg_type typeStruct;
PLpgSQL_type *typ;
char *cp[2];
+ char *colname[1];
int qualified_att_len;
int numdots = 0;
int i;
@@ -1135,7 +1136,7 @@ plpgsql_parse_tripwordtype(char *word)
}
}
- relvar = makeRangeVarFromNameList(stringToQualifiedNameList(cp[0], "plpgsql_parse_dblwordtype"));
+ relvar = makeRangeVarFromNameList(stringToQualifiedNameList(cp[0], "plpgsql_parse_tripwordtype"));
classOid = RangeVarGetRelid(relvar, true);
if (!OidIsValid(classOid))
{
@@ -1171,7 +1172,10 @@ plpgsql_parse_tripwordtype(char *word)
/*
* Fetch the named table field and it's type
*/
- attrtup = SearchSysCacheAttName(classOid, cp[1]);
+ plpgsql_convert_ident(cp[1], colname, 1);
+ attrtup = SearchSysCacheAttName(classOid, colname[0]);
+ pfree(colname[0]);
+
if (!HeapTupleIsValid(attrtup))
{
ReleaseSysCache(classtup);
@@ -1273,7 +1277,7 @@ plpgsql_parse_dblwordrowtype(char *word)
memcpy(cp, word, i * sizeof(char));
/* Lookup the relation */
- relvar = makeRangeVarFromNameList(stringToQualifiedNameList(cp, "plpgsql_parse_dblwordtype"));
+ relvar = makeRangeVarFromNameList(stringToQualifiedNameList(cp, "plpgsql_parse_dblwordrowtype"));
classOid = RangeVarGetRelid(relvar, true);
if (!OidIsValid(classOid))
elog(ERROR, "%s: no such class", cp);