Skip Menu |

This queue is for tickets about the DBD-Pg CPAN distribution.

Report information
The Basics
Id: 107556
Status: resolved
Priority: 0/
Queue: DBD-Pg

People
Owner: greg [...] turnstep.com
Requestors: s.zuban [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: (no value)
Fixed in: 3.7.1



Subject: read-only undef returned for NULLs in arrays
Date: Mon, 5 Oct 2015 11:29:07 -0500
To: bug-DBD-Pg [...] rt.cpan.org
From: Sergiy Zuban <s.zuban [...] gmail.com>
In Perl 5.20+ handling of NULLs in arrays is not consistent with NULLs in regular columns. Code below fails in attempt to modify undef value, because it's marked as read-only. my $sth = $dbh->prepare(qq!SELECT 5, NULL, ARRAY[1,2,3], ARRAY[1,NULL,3]!); $sth->execute; while( my $row = $sth->fetchrow_arrayref ) { $row->[0] += 0; # ok $row->[1] += 0; # ok $_ += 0 foreach @{ $row->[2] }; # ok $_ += 0 foreach @{ $row->[3] }; # error: Modification of a read-only value attempted } It may be related to the way how read-only and copy-on-write scalars should be checked in perl 5.20+: http://search.cpan.org/~rjbs/perl-5.20.0/pod/perlguts.pod#Read-Only_Values DBI 1.634 DBD::Pg 3.5.3 PostgreSQL 9.4.4 This is perl 5, version 20, subversion 2 (v5.20.2) built for x86_64-linux -- Sergiy Zuban
Thank you for the report: sorry this took so long to get to. Should be fixed in 27b3aa92aab1fbaa372c06d470b7a6079752a828 and will be part of the next release.