summaryrefslogtreecommitdiff
path: root/src/pl/plperl/plperl.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-05-01 18:56:19 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-05-01 18:56:19 +0000
commit6c412f0605afeb809014553ff7ad28cf9ed5526b (patch)
tree5540a678c19dcfa1a7023e0f59a970fe2a9a79ee /src/pl/plperl/plperl.c
parentae793ff63cb9167ea6d0f24ca018ffabad157ece (diff)
Change CREATE TYPE to require datatype output and send functions to have
only one argument. (Per recent discussion, the option to accept multiple arguments is pretty useless for user-defined types, and would be a likely source of security holes if it was used.) Simplify call sites of output/send functions to not bother passing more than one argument.
Diffstat (limited to 'src/pl/plperl/plperl.c')
-rw-r--r--src/pl/plperl/plperl.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/pl/plperl/plperl.c b/src/pl/plperl/plperl.c
index 9b0cfe3815d..e4c2f4d587c 100644
--- a/src/pl/plperl/plperl.c
+++ b/src/pl/plperl/plperl.c
@@ -33,7 +33,7 @@
* ENHANCEMENTS, OR MODIFICATIONS.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.71 2005/04/01 19:34:06 tgl Exp $
+ * $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.72 2005/05/01 18:56:19 tgl Exp $
*
**********************************************************************/
@@ -83,7 +83,6 @@ typedef struct plperl_proc_desc
Oid result_typioparam;
int nargs;
FmgrInfo arg_out_func[FUNC_MAX_ARGS];
- Oid arg_typioparam[FUNC_MAX_ARGS];
bool arg_is_rowtype[FUNC_MAX_ARGS];
SV *reference;
} plperl_proc_desc;
@@ -707,10 +706,8 @@ plperl_call_perl_func(plperl_proc_desc *desc, FunctionCallInfo fcinfo)
{
char *tmp;
- tmp = DatumGetCString(FunctionCall3(&(desc->arg_out_func[i]),
- fcinfo->arg[i],
- ObjectIdGetDatum(desc->arg_typioparam[i]),
- Int32GetDatum(-1)));
+ tmp = DatumGetCString(FunctionCall1(&(desc->arg_out_func[i]),
+ fcinfo->arg[i]));
XPUSHs(sv_2mortal(newSVpv(tmp, 0)));
pfree(tmp);
}
@@ -1322,7 +1319,6 @@ compile_plperl_function(Oid fn_oid, bool is_trigger)
prodesc->arg_is_rowtype[i] = false;
perm_fmgr_info(typeStruct->typoutput,
&(prodesc->arg_out_func[i]));
- prodesc->arg_typioparam[i] = getTypeIOParam(typeTup);
}
ReleaseSysCache(typeTup);
@@ -1386,7 +1382,6 @@ plperl_hash_from_tuple(HeapTuple tuple, TupleDesc tupdesc)
char *attname;
char *outputstr;
Oid typoutput;
- Oid typioparam;
bool typisvarlena;
int namelen;
@@ -1406,12 +1401,10 @@ plperl_hash_from_tuple(HeapTuple tuple, TupleDesc tupdesc)
/* XXX should have a way to cache these lookups */
getTypeOutputInfo(tupdesc->attrs[i]->atttypid,
- &typoutput, &typioparam, &typisvarlena);
+ &typoutput, &typisvarlena);
- outputstr = DatumGetCString(OidFunctionCall3(typoutput,
- attr,
- ObjectIdGetDatum(typioparam),
- Int32GetDatum(tupdesc->attrs[i]->atttypmod)));
+ outputstr = DatumGetCString(OidFunctionCall1(typoutput,
+ attr));
hv_store(hv, attname, namelen, newSVpv(outputstr, 0), 0);
}