Subject: | restore is crashing if table is empty. |
Date: | Mon, 29 Jun 2015 22:20:36 +1000 |
To: | bug-DBIx-Admin-BackupRestore [...] rt.cpan.org |
From: | Marcos Georgopoulos <me [...] marcosg.com> |
Hi,
Firstly thank you for your hard work with this module.
I have an issue where restore_in_order is failing if a table has no rows.
I'm not a very good coder but it appears that if there are no rows then you
go to the next record in your code below;
$self -> process_table('Restore', $candidate_table);
# Warning: At this point, if the input file has no data for a table,
# $$record{'row'} will be undef, so don't access @{$$record{'row'} }.
next if (! $$record{'row'});
If we are already at this point in the code haven't we already found the
matching resultset for the tablename specified? So wouldn't it be efficient
to break out of the loop here?
I am finding what is happening is after it finds the matching resultset for
my table with no rows it then goes on through processing the other records
and seems to eventually crash calling get_record at the top of the infinite
for loop.
I hope this makes sense.
Once again thank you for your help.