DBD::Pg 1.31 builds fine on Mac OS X (10.3.0) and passes all tests, as shown
below.  But when I try to use it to fetch the value of an ARRAY column, it
hangs.  Here's how to trigger the bug:

test=# create table array_test ( mycol INT[] NOT NULL );
test=# insert into array_test (mycol) VALUES ('{1, 2}');

---

#!/usr/bin/perl

use strict;

use DBI;

my $dbh = DBI->connect('dbi:Pg:dbname=test');

my $sth = $dbh->prepare(q(SELECT mycol FROM array_test));

$sth->execute();

while(my $val = $sth->fetchrow_array) # XXX: hangs here!
{
  print $val, "\n";
}

$sth->finish;
$dbh->disconnect;

---

If I downgrade to DBD::Pg 1.22, this bug disappears.

-John

---

Here's some info about my system:

% uname -a
Darwin derkins 7.0.0 Darwin Kernel Version 7.0.0: Wed Sep 24 15:48:39 PDT
2003; root:xnu/xnu-517.obj~1/RELEASE_PPC  Power Macintosh powerpc

Here's the test run of DBD::Pg 1.31:

% make test
Running Mkbootstrap for DBD::Pg ()
chmod 644 Pg.bs
rm -f blib/arch/auto/DBD/Pg/Pg.bundle
LD_RUN_PATH="" cc  -bundle -undefined dynamic_lookup -L/usr/local/lib Pg.o
dbdimp.o quote.o types.o  -o blib/arch/auto/DBD/Pg/Pg.bundle
-L/usr/local/pgsql/lib -lpq
chmod 755 blib/arch/auto/DBD/Pg/Pg.bundle
cp Pg.bs blib/arch/auto/DBD/Pg/Pg.bs
chmod 644 blib/arch/auto/DBD/Pg/Pg.bs
PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00basic...........ok
t/01connect.........ok 1/2#
# Package       Version
# DBD::Pg       1.31
# DBI           1.38
t/01connect.........ok 2/2# Postgres      7.4
t/01connect.........ok
t/01constants.......ok
t/01setup...........ok
t/02prepare.........ok
t/03bind............ok
t/04execute.........ok
t/04rows............ok
t/05fetch...........ok
t/06disconnect......ok
t/07reuse...........ok
t/08txn.............ok
t/09autocommit......ok
t/10chopblanks......ok
t/11quoting.........ok
t/12placeholders....ok
t/13pgtype..........ok
t/15column_info.....ok
t/15funct...........ok
t/15table_attrs.....ok
t/15table_info......ok
t/16pgbooltf........# DBD::Pg version: 1.31
t/16pgbooltf........ok
t/17arrays..........ok
t/99_pod............ok
t/99cleanup.........ok
All tests successful.
Files=25, Tests=269,  5 wallclock secs ( 2.12 cusr +  0.80 csys =  2.92 CPU)

% perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 1) configuration:
  Platform:
    osname=darwin, osvers=7.0.0, archname=darwin-2level
    uname='darwin derkins.local 7.0.0 darwin kernel version 7.0.0: wed sep
24 15:48:39 pdt 2003; root:xnuxnu-517.obj~1release_ppc power macintosh
powerpc '
    config_args=''
    hint=previous, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-pipe -fno-common -DPERL_DARWIN -no-cpp-precomp
-fno-strict-aliasing -mcpu=970 -mtune=970 -mpowerpc64 -mpowerpc-gpopt',
    optimize='-O3',
    cppflags='-no-cpp-precomp -pipe -fno-common -DPERL_DARWIN
-no-cpp-precomp -fno-strict-aliasing -mcpu=970 -mtune=970 -mpowerpc64
-mpowerpc-gpopt -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp
-fno-strict-aliasing -mcpu=970 -mtune=970 -mpowerpc64 -mpowerpc-gpopt'
    ccversion='', gccversion='3.3 20030304 (Apple Computer, Inc. build
1495)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib
    libs=-ldbm -ldl -lm -lc
    perllibs=-ldl -lm -lc
    libc=/usr/lib/libc.dylib, so=dylib, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dyld.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup
-L/usr/local/lib'


Characteristics of this binary (from libperl):
  Compile-time options: USE_LARGE_FILES
  Built under darwin
  Compiled at Oct 16 2003 15:21:50
  %ENV:
    PERL_READLINE_NOWARN=""
    PERL_RL=" o=0"
  @INC:
    /usr/local/lib/perl5/5.8.1/darwin-2level
    /usr/local/lib/perl5/5.8.1
    /usr/local/lib/perl5/site_perl/5.8.1/darwin-2level
    /usr/local/lib/perl5/site_perl/5.8.1
    /usr/local/lib/perl5/site_perl


Reply via email to