Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: jpo [...] di.uminho.pt
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.41
Fixed in: 1.43



Subject: DBD::Pg 1.41 fails 4 tests
Platform: Linux Fedora Core 3 (i686) Linux 2.6.10-1.770_FC3 Perl: This is perl, v5.8.5 built for i386-linux-thread-multi PostgreSQL: postgresql-7.4.7-3.FC3.1 DBI: 1.40 t/03dbmethod........1..137 ok 1 - Connect to database for database handle method testing not ok 2 - DB handle method "last_insert_id" given an error when no arguments are given # Failed test (t/03dbmethod.t at line 67) not ok 3 - DB handle method "last_insert_id" fails when given a non-existent sequence # Failed test (t/03dbmethod.t at line 72) not ok 4 - DB handle method "last_insert_id" fails when given a non-existent table # Failed test (t/03dbmethod.t at line 78) ok 5 - DB handle method "last_insert_id" works when given a valid sequence and an invalid table not ok 6 - DB handle method "last_insert_id" returns a numeric value # Failed test (t/03dbmethod.t at line 85) # undef # doesn't match '(?-xism:^\d+$)' ok 7 - DB handle method "last_insert_id" works when given a valid table ... # Looks like you failed 4 tests of 137. dubious Test returned status 4 (wstat 1024, 0x400) DIED. FAILED tests 2-4, 6 Failed 4/137 tests, 97.08% okay ... Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------------- t/03dbmethod.t 4 1024 137 4 2.92% 2-4 6 17 subtests skipped. Failed 1/15 test scripts, 93.33% okay. 4/412 subtests failed, 99.03% okay.
From: jpo [...] di.uminho.pt
[guest - Fri Apr 8 14:33:35 2005]: DBD::Pg 1.40 also reports 4 failed tests (the same ones). No problems with the test suite of DBD::Pg 1.31 and 1.32 (same Linux, PostgreSQL, perl, and DBI versions). DBD-Pg 1.40 ----------- ... t/03dbmethod........1..141 ok 1 - Connect to database for database handle method testing not ok 2 - DB handle method "last_insert_id" given an error when no arguments are given # Failed test (t/03dbmethod.t at line 65) not ok 3 - DB handle method "last_insert_id" fails when given a non-existent sequence # Failed test (t/03dbmethod.t at line 70) not ok 4 - DB handle method "last_insert_id" fails when given a non-existent table # Failed test (t/03dbmethod.t at line 76) ok 5 - DB handle method "last_insert_id" works when given a valid sequence and an invalid table not ok 6 - DB handle method "last_insert_id" returns a numeric value # Failed test (t/03dbmethod.t at line 83) # undef # doesn't match '(?-xism:^\d+$)' ok 7 - DB handle method "last_insert_id" works when given a valid table ... Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------------- t/03dbmethod.t 4 1024 141 4 2.84% 2-4 6 15 subtests skipped. Failed 1/12 test scripts, 91.67% okay. 4/385 subtests failed, 98.96% okay.
These are harmless test failures that are a result of older versions of DBI not having full last_insert_id)_ support. The tests have been fixed in cvs and will be part of the next release (1.42). Upgrading your DBI to version 1.43 or better will also make it go away.
[DBDPG - Tue Apr 12 21:15:40 2005]: Show quoted text
> These are harmless test failures that are a result of older versions of > DBI not having full last_insert_id)_ support. The tests have been fixed > in cvs and will be part of the next release (1.42). Upgrading your DBI > to version 1.43 or better will also make it go away.
Thanks for the update. /jpo
Subject: DBD::Pg 1.41 fails tests
[DBDPG - Tue Apr 12 21:15:40 2005]: New error --------- In a "FC4 test 2" system the test suite fails with a different error. System: Fedora Core 4 test 2 (i386) Perl: This is perl, v5.8.6 built for i386-linux-thread-multi DBI: perl-DBI-1.48-3 PostgreSQL: postgresql-8.0.1-5 Output: ... t/01connect.........ok 8/8# # Program Version # Perl 5.8.6 (linux) # DBD::Pg 1.41 # PostgreSQL (compiled) 80001 # PostgreSQL (target) 80001 # DBI 1.48 # DBI_DSN dbi:Pg:dbname=lixo t/01connect.........ok t/01constants.......ok t/01setup...........ok 1/4Use of uninitialized value in numeric eq (==) at t/01setup.t line 36. Use of uninitialized value in numeric eq (==) at t/01setup.t line 41. t/01setup...........NOK 2# Failed test (t/01setup.t at line 64) FAILED--Further testing stopped: Test table could not be created: ERROR: relation "dbd_pg_test" already exists ...
[guest - Wed Apr 13 20:57:36 2005]: Show quoted text
> [DBDPG - Tue Apr 12 21:15:40 2005]: > > New error > --------- > In a "FC4 test 2" system the test suite fails with a different error. > > System: > Fedora Core 4 test 2 (i386) > Perl: > This is perl, v5.8.6 built for i386-linux-thread-multi > DBI: > perl-DBI-1.48-3 > PostgreSQL: > postgresql-8.0.1-5
Update on the FC4 test suite errors ----------------------------------- The test suite errors appear to be caused by gcc4. The test suite runs ok if perl-DBD-Pg is compiled with gcc32. For more information please see comments #3 and #5 of: * Bug 156840: perl-DBD-pg Placeholders no longer functioning https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=156840
[guest - Tue May 17 19:05:09 2005]: Update on the FC4/gcc4 test suite errors ---------------------------------------- DBD-Pg 1.41 (and 1.41_2) passes the test suite if compiled with gcc4 with optimizations disabled (-O2 -> -O0) Packages: kernel-2.6.11-1.1315_FC4 perl-5.8.6-13 postgresql-8.0.3-1 gcc-4.0.0-6 Red Hat Bugzilla entry https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=156840 comment #9
Subject: DBD::Pg 1.41 fails 4 tests (gcc4/glibc/_FORTIFY_SOURCE=2)
From: jpo [...] di.uminho.pt
Another update on the FC4/gcc4/glibc/_FORTIFY_SOURCE test suite errors (there is a problem in the dbdimp.c file) ---------------------------------------------------------------------- DBD-Pg versions affected: 1.4{0,1,2} The problem is not related to the gcc optimization level as initial thought, but due to a non-recommended use of sprintf in the dbdimp.c file: ... if (currseg->placeholder) { sprintf(statement, "%s$%d", statement, currseg->placeholder); } ... The buffer overlap (the statement buffer being used as destination and source) has been exposed by the new gcc4/glibc/_FORTIFY_SOURCE buffer overflow protection (-Wp,-D_FORTIFY_SOURCE=2). * dbdimp.c patch: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=156840#c27 ... if (currseg->placeholder) { - sprintf(statement, "%s$%d", statement, currseg->placeholder); + sprintf(strchr(statement, '\0'), "$%d", currseg->placeholder); } ... * gcc4/glibc/_FORTIFY_SOURCE buffer overflow protection: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=156840#c20 * Further code cleanup/optimizations: 1) see last paragraph of comment #23 2) see second half of comment #27 * problematic sprintf statements: 1) the one in line 1246 (the one described above) 2) the one in line 1677
[guest - Tue May 24 17:37:00 2005]: I noticed that you have already patched DBD-Pg. Would it be possible to upload a new DBD-Version or snapshot to CPAN? Thanks in advance, jpo Patch in question http://gborg.postgresql.org/project/dbdpg/cvs/diff.php/dbdpg/dbdimp.c?r1=1.134&r2=1.136&ty=u