Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: tomas.olaj [...] usit.uio.no
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.32_1
Fixed in: 1.32



Subject: DBD:PG test failes
bash-2.05b$ make test Running Mkbootstrap for DBD::Pg () chmod 644 Pg.bs rm -f blib/arch/auto/DBD/Pg/Pg.so LD_RUN_PATH="/local/opt/postgresql/lib" cc -shared -L/usr/local/lib Pg.o dbdimp.o quote.o types.o -o blib/arch/auto/DBD/Pg/Pg.so -L/local/opt/postgresql/lib -lpq chmod 755 blib/arch/auto/DBD/Pg/Pg.so cp Pg.bs blib/arch/auto/DBD/Pg/Pg.bs chmod 644 blib/arch/auto/DBD/Pg/Pg.bs PERL_DL_NONLAZY=1 /site/perl-5.8.4/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/00basic...........ok t/01connect.........# # Program Version # DBD::Pg 1.32 # PostgreSQL 7.3.5 # DBI 1.43 t/01connect.........ok t/01constants.......ok t/01setup...........ok t/02attribs.........Can't set DBI::db=HASH(0x81cfc58)->{CrazyDiamond}: unrecognised attribute or invalid value at t/02attribs.t line 94. # Failed test (t/02attribs.t at line 96) Can't set DBI::st=HASH(0x8223d88)->{CrazyDiamond}: unrecognised attribute or invalid value at t/02attribs.t line 106. # Failed test (t/02attribs.t at line 108) t/02attribs.........ok 13/92# Failed test (t/02attribs.t at line 270) # got: undef # expected: '0' t/02attribs.........ok 91/92# Looks like you failed 3 tests of 92. t/02attribs.........dubious Test returned status 3 (wstat 768, 0x300) DIED. FAILED tests 4, 6, 39 Failed 3/92 tests, 96.74% okay t/03dbmethod........ok t/03smethod.........ok t/04misc............ok t/05arrays..........ok 15/17 skipped: Array support not implemented t/12placeholders....ok t/99_pod............ok t/99cleanup.........ok Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------------- t/02attribs.t 3 768 92 3 3.26% 4 6 39 15 subtests skipped. Failed 1/12 test scripts, 91.67% okay. 3/349 subtests failed, 99.14% okay. make: *** [test_dynamic] Error 255 bash-2.05b$
From: scott [...] cs.tamu.edu
I also recieve the same failed tests here at Texas A&M. Here is our configuration: Solaris 5.8 Perl 5.8.4 DBI 1.43 Postgres 7.4.1
Subject: DBD:PG test failes [patch]
From: Geoff Richards <geoffr [...] gbdirect.co.uk>
Hi, I've tracked down the problem that caused three of the tests in t/02attribs.t to fail. It was two changes in DBI versions 1.42 and 1.43. I've attached a patch that adjusts the tests to expect the new behaviour. They should also pass with older versions. qef [guest - Mon Jul 19 13:17:03 2004]: Show quoted text
> bash-2.05b$ make test > ... > t/02attribs.........Can't set DBI::db=HASH(0x81cfc58)->{CrazyDiamond}: > unrecognised attribute or invalid value at t/02attribs.t line 94. > # Failed test (t/02attribs.t at line 96) > Can't set DBI::st=HASH(0x8223d88)->{CrazyDiamond}: unrecognised > attribute or invalid value at t/02attribs.t line 106. > # Failed test (t/02attribs.t at line 108) > t/02attribs.........ok 13/92# Failed test (t/02attribs.t at line > 270) > # got: undef > # expected: '0' > t/02attribs.........ok 91/92# Looks like you failed 3 tests of 92. > t/02attribs.........dubious > Test returned status 3 (wstat 768, 0x300) > DIED. FAILED tests 4, 6, 39 > Failed 3/92 tests, 96.74% okay > ...
diff -ur DBD-Pg-1.32.orig/t/02attribs.t DBD-Pg-1.32/t/02attribs.t --- DBD-Pg-1.32.orig/t/02attribs.t 2004-02-14 13:06:03.000000000 +0000 +++ DBD-Pg-1.32/t/02attribs.t 2004-09-08 11:37:37.000000000 +0100 @@ -91,6 +91,8 @@ # eval { + # In versions of DBI < 1.43 this died, but now it warns. Catch it either way. + local $SIG{__WARN__} = sub { die shift }; $dbh->{CrazyDiamond}=1; }; ok( $@, 'Error raised when setting an invalid database handle attribute'); @@ -103,6 +105,8 @@ $sth = $dbh->prepare('SELECT 123'); eval { + # In versions of DBI < 1.43 this died, but now it warns. Catch it either way. + local $SIG{__WARN__} = sub { die shift }; $sth->{CrazyDiamond}=1; }; ok( $@, 'Error raised when setting an invalid statement handle attribute'); @@ -267,7 +271,8 @@ $sth = $dbh->prepare("DELETE FROM dbd_pg_test WHERE id=0"); $sth->execute(); $attrib = $sth->{'NUM_OF_FIELDS'}; -is( $attrib, '0', 'Statement handle attribute "NUM_OF_FIELDS" works correctly for DELETE'); +is( $attrib, ($DBI::VERSION >= 1.42 ? undef : '0'), + 'Statement handle attribute "NUM_OF_FIELDS" works correctly for DELETE'); $attrib = $sth->{'NUM_OF_PARAMS'}; is( $attrib, '0', 'Statement handle attribute "NUM_OF_PARAMS" works correctly with no placeholder'); $attrib = $sth->{NAME};
Geoff, is right, this was due to a change in DBI. The next release of DBD::Pg will have the fix.