--- plperl.c~ 2004-10-02 04:12:05.189765562 +0530 +++ plperl.c 2004-10-02 04:12:28.017002164 +0530 @@ -1270,6 +1270,7 @@ compile_plperl_function(Oid fn_oid, bool int proname_len; plperl_proc_desc *prodesc = NULL; int i; + SV **svp; /* We'll need the pg_proc tuple in any case... */ procTup = SearchSysCache(PROCOID, @@ -1292,12 +1293,12 @@ compile_plperl_function(Oid fn_oid, bool /************************************************************ * Lookup the internal proc name in the hashtable ************************************************************/ - if (hv_exists(plperl_proc_hash, internal_proname, proname_len)) + svp = hv_fetch(plperl_proc_hash, internal_proname, proname_len, FALSE); + if (svp) { bool uptodate; - prodesc = (plperl_proc_desc *) SvIV(*hv_fetch(plperl_proc_hash, - internal_proname, proname_len, 0)); + prodesc = (plperl_proc_desc *) SvIV(*svp); /************************************************************ * If it's present, must check whether it's still up to date. @@ -1625,7 +1626,7 @@ plperl_hash_from_tuple(HeapTuple tuple, if (attdata) hv_store(array, attname, strlen(attname), newSVpv(attdata, 0), 0); else - hv_store(array, attname, strlen(attname), newSVpv("undef", 0), 0); + hv_store(array, attname, strlen(attname), newSV(0), 0); } return array; }