diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-12-01 17:58:48 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-12-01 17:58:48 +0000 |
commit | 5aa57951db5af7df8034a398a69f3f098734156b (patch) | |
tree | a09be1d305b6c74a1da1b48b83ce5ce742f03ce6 | |
parent | d36795142e98a876886b3e4b595d7303cde7bbde (diff) | |
download | postgresql-5aa57951db5af7df8034a398a69f3f098734156b.tar.gz postgresql-5aa57951db5af7df8034a398a69f3f098734156b.zip |
Suppress compiler warnings in recent plperl patch. Avoid uselessly expensive
lookup of the well-known OID of textout().
-rw-r--r-- | src/pl/plperl/plperl.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/src/pl/plperl/plperl.c b/src/pl/plperl/plperl.c index 9470757c433..8cc8eda2053 100644 --- a/src/pl/plperl/plperl.c +++ b/src/pl/plperl/plperl.c @@ -1,7 +1,7 @@ /********************************************************************** * plperl.c - perl as a procedural language for PostgreSQL * - * $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.123.2.2 2007/12/01 15:31:30 adunstan Exp $ + * $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.123.2.3 2007/12/01 17:58:48 tgl Exp $ * **********************************************************************/ @@ -23,6 +23,7 @@ #include "miscadmin.h" #include "nodes/makefuncs.h" #include "parser/parse_type.h" +#include "utils/fmgroids.h" #include "utils/guc.h" #include "utils/lsyscache.h" #include "utils/memutils.h" @@ -509,7 +510,6 @@ plperl_safe_init(void) eval_pv(SAFE_OK, FALSE); if (GetDatabaseEncoding() == PG_UTF8) { - /* * Fill in just enough information to set up this perl * function in the safe container and call it. @@ -517,12 +517,8 @@ plperl_safe_init(void) * can arise from the regex code later trying to load * utf8 modules. */ - plperl_proc_desc desc; FunctionCallInfoData fcinfo; - FmgrInfo outfunc; - HeapTuple typeTup; - Form_pg_type typeStruct; SV *ret; SV *func; @@ -534,24 +530,17 @@ plperl_safe_init(void) "return shift =~ /\\xa9/i ? 'true' : 'false' ;", true); - /* set up to call the function with a single text argument 'a' */ desc.reference = func; desc.nargs = 1; desc.arg_is_rowtype[0] = false; + fmgr_info(F_TEXTOUT, &(desc.arg_out_func[0])); + + fcinfo.arg[0] = DirectFunctionCall1(textin, CStringGetDatum("a")); fcinfo.argnull[0] = false; - fcinfo.arg[0] = - DatumGetTextP(DirectFunctionCall1(textin, - CStringGetDatum("a"))); - typeTup = SearchSysCache(TYPEOID, - TEXTOID, - 0, 0, 0); - typeStruct = (Form_pg_type) GETSTRUCT(typeTup); - fmgr_info(typeStruct->typoutput,&(desc.arg_out_func[0])); - ReleaseSysCache(typeTup); /* and make the call */ - ret = plperl_call_perl_func(&desc,&fcinfo); + ret = plperl_call_perl_func(&desc, &fcinfo); } } |