Skip Menu |

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

Report information
The Basics
Id: 48655
Status: resolved
Priority: 0/
Queue: DBIx-Report-Excel

People
Owner: Nobody in particular
Requestors: bricas [...] cpan.org
Cc:
AdminCc:

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



Subject: Failure when SQL statement returns no rows
If one happens to have an empty table, DBIx::Report::Excel seems to balk entirely instead of gracefully ignoring the result. Can't use an undefined value as an ARRAY reference at /usr/local/share/perl/5.10.0/DBIx/Report/Excel.pm line 290. Attached is a patch to simply ignore empty results.
Subject: no-results.patch
--- lib/DBIx/Report/Excel.pm.orig 2009-07-24 00:35:17.000000000 -0300 +++ lib/DBIx/Report/Excel.pm 2009-08-12 12:22:01.000000000 -0300 @@ -282,6 +282,8 @@ $self->{'data'} = $self->{'dbh'}->selectall_arrayref($sql); + return unless scalar @{ $self->{ data } }; + # ---------------------------------------- # Define column names. my $parser = SQL::Parser->new();
resolved in v.0.2