Skip Menu |

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

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

People
Owner: greg [...] turnstep.com
Requestors: sam [...] hellosam.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.8.1
Fixed in: (no value)



Subject: One Element is added when Empty array is selected
Repro version Linux hostname 2.6.28.2-pdc #15 SMP PREEMPT Wed Jan 28 00:55:39 HKT 2009 x86_64 GNU/Linux Perl v5.8.8 DBI 1.607 DBD::Pg 2.011008 use DBI; use Data::Dumper; $dbh = DBI->connect('dbi:Pg',...,...); print Dumper $dbh->selectall_arrayref(q{SELECT array(SELECT 12345::int WHERE 1=0)::int[]}); print Dumper $dbh->selectall_arrayref(q{SELECT array(SELECT 'empty'::text WHERE 1=0)::text[]}); The result should be [] and [], but instead it produces [0] and ['']
On Sat Mar 07 13:33:06 2009, sam0737 wrote: Show quoted text
> Repro version > Linux hostname 2.6.28.2-pdc #15 SMP PREEMPT Wed Jan 28 00:55:39 HKT 2009 > x86_64 GNU/Linux > Perl v5.8.8 > DBI 1.607 > DBD::Pg 2.011008 > > use DBI; > use Data::Dumper; > $dbh = DBI->connect('dbi:Pg',...,...); > > print Dumper $dbh->selectall_arrayref(q{SELECT array(SELECT 12345::int > WHERE 1=0)::int[]}); > print Dumper $dbh->selectall_arrayref(q{SELECT array(SELECT > 'empty'::text WHERE 1=0)::text[]}); > > The result should be [] and [], but instead it produces [0] and ['']
Sorry I selected the wrong broken version. And it looks like to be an regression of this: http://www.nabble.com/PostgreSQL-arrays-and-DBD-td18977671.html
Can you double check the version you are using? I cannot duplicate the results you got. However, I am noticing a difference between empty and undef entries on different machines. But none of the machines I tested output 0 or ''.
On Tue Mar 10 19:40:12 2009, greg@turnstep.com wrote: Show quoted text
> Can you double check the version you are using? I cannot duplicate the > results you got. However, I am noticing a difference between empty and > undef entries on different machines.
Followup: this is due to a change in the way Postgres returns array in different versions, but it does not seem to affect the tests.
Still cannot duplicate this on the latest DBD::Pg against Postgres 8.4, 8.3, 8.2, 8.1, or 8.0.