Skip Menu |
 

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

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

People
Owner: Nobody in particular
Requestors: ivan-dbdpg [...] 420.am
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.40
Fixed in: 1.41



MIME-Version: 1.0
X-Mailer: MIME-tools 5.415 (Entity 5.415)
Subject: commit method returns false
Content-Type: multipart/mixed; boundary="----------=_1111789211-16661-0"
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: iso-8859-1
Content-Length: 713
Download (untitled) / with headers
text/plain 713b
DBD::Pg 1.40 as well as CVS as of Mar 25 2005 returns a false value in response to $dbh->commit(), but no error is available in $dbh->errstr. It should return true if the commit was sucessful, or return false and set errstr if the commit was unsucessful. Code which uses the common idiom "$dbh->commit or die $dbh->errstr" winds up emitting the cryptic error message "Use of uninitialized value in die". A test case suitable for inclusion in t/ is attached as 08commit.t. Reproduced on Debian sid, Perl 5.8.4-6, Pg 7.4.7-3, DBI 1.46-6. From the reports I've been getting from my users this doesn't seem to be specific to one OS or Pg version. This is a regression from 1.32 and should be fixed for 1.41.
Content-Type: text/plain; name="08commit.t"
Content-Disposition: inline; filename="08commit.t"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: iso-8859-1
Content-Length: 582
Download 08commit.t
text/x-perl 582b
#!perl -w use Test::More; use DBI; use strict; $| = 1; if (defined $ENV{DBI_DSN}) { plan tests => 2; } else { plan skip_all => 'Cannot run test unless DBI_DSN is defined. See the REA DME file'; } my $dbh = DBI->connect($ENV{DBI_DSN}, $ENV{DBI_USER}, $ENV{DBI_PASS}, {RaiseError => 1, PrintError => 0, AutoCommit => 0}); ok( defined $dbh, "Connect to database for commit test"); ok( $dbh->commit, '$dbh->commit returns true') or diag($dbh->errstr); $dbh->disconnect();


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.