aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pl/plperl/plperl.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/pl/plperl/plperl.c b/src/pl/plperl/plperl.c
index d69d2327bb0..f2e8ad22078 100644
--- a/src/pl/plperl/plperl.c
+++ b/src/pl/plperl/plperl.c
@@ -1357,7 +1357,13 @@ make_array_ref(plperl_array_info *info, int first, int last)
for (i = first; i < last; i++)
{
if (info->nulls[i])
- av_push(result, &PL_sv_undef);
+ {
+ /*
+ * We can't use &PL_sv_undef here. See "AVs, HVs and undefined
+ * values" in perlguts.
+ */
+ av_push(result, newSV(0));
+ }
else
{
Datum itemvalue = info->elements[i];
@@ -2639,8 +2645,12 @@ plperl_hash_from_tuple(HeapTuple tuple, TupleDesc tupdesc)
if (isnull)
{
- /* Store (attname => undef) and move on. */
- hv_store_string(hv, attname, &PL_sv_undef);
+ /*
+ * Store (attname => undef) and move on. Note we can't use
+ * &PL_sv_undef here; see "AVs, HVs and undefined values" in
+ * perlguts for an explanation.
+ */
+ hv_store_string(hv, attname, newSV(0));
continue;
}