aboutsummaryrefslogtreecommitdiff
path: root/contrib/hstore_plperl/hstore_plperl.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/hstore_plperl/hstore_plperl.c')
-rw-r--r--contrib/hstore_plperl/hstore_plperl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/hstore_plperl/hstore_plperl.c b/contrib/hstore_plperl/hstore_plperl.c
index 480212f341e..cc46a525f6f 100644
--- a/contrib/hstore_plperl/hstore_plperl.c
+++ b/contrib/hstore_plperl/hstore_plperl.c
@@ -67,6 +67,7 @@ PG_FUNCTION_INFO_V1(hstore_to_plperl);
Datum
hstore_to_plperl(PG_FUNCTION_ARGS)
{
+ dTHX;
HStore *in = PG_GETARG_HS(0);
int i;
int count = HS_COUNT(in);
@@ -99,7 +100,8 @@ PG_FUNCTION_INFO_V1(plperl_to_hstore);
Datum
plperl_to_hstore(PG_FUNCTION_ARGS)
{
- HV *hv;
+ dTHX;
+ HV *hv = (HV *) SvRV((SV *) PG_GETARG_POINTER(0));
HE *he;
int32 buflen;
int32 i;
@@ -107,8 +109,6 @@ plperl_to_hstore(PG_FUNCTION_ARGS)
HStore *out;
Pairs *pairs;
- hv = (HV *) SvRV((SV *) PG_GETARG_POINTER(0));
-
pcount = hv_iterinit(hv);
pairs = palloc(pcount * sizeof(Pairs));