Skip Menu |
 

This queue is for tickets about the DBIx-SearchBuilder CPAN distribution.

Report information
The Basics
Id: 55203
Status: patched
Worked: 10 min
Priority: 0/
Queue: DBIx-SearchBuilder

People
Owner: RUZ [...] cpan.org
Requestors: dan-perl [...] drown.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: [patch] [enhancement] DBIx::SearchBuilder::Record::_LoadFromSQL return database error message
Download (untitled) / with headers
text/plain 403b
If _LoadFromSQL fails to execute the sql query, it currently returns with: (0, "Couldn't execute query") This patch (against DBIx::SearchBuilder::Record in 1.56) changes the return message to include the error message from the database handle. An example message would be: "Lost connection to MySQL server during query". Passing this message back to the caller can make debugging problems easier.
Subject: Record-errstr.patch
Download Record-errstr.patch
text/x-diff 432b
--- Record.pm.orig 2010-03-03 18:55:31.000000000 -0600 +++ Record.pm 2010-03-03 18:55:58.000000000 -0600 @@ -1208,7 +1208,7 @@ #TODO this only gets the first row. we should check if there are more. - return ( 0, "Couldn't execute query" ) unless $sth; + return ( 0, "Couldn't execute query: ".$self->_Handle->dbh->errstr ) unless $sth; $self->{'values'} = $sth->fetchrow_hashref; $self->{'fetched'} = {};
Download (untitled) / with headers
text/plain 547b
Thanks. Patched repository. Will be in next release. On Wed Mar 03 20:03:25 2010, ddrown wrote: Show quoted text
> If _LoadFromSQL fails to execute the sql query, it currently returns > with: (0, "Couldn't execute query") > > This patch (against DBIx::SearchBuilder::Record in 1.56) changes the > return message to include the error message from the database
handle. An Show quoted text
> example message would be: "Lost connection to MySQL server during
query". Show quoted text
> Passing this message back to the caller can make debugging
problems Show quoted text
> easier.
-- Best regards, Ruslan.


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.