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();