From: Eric Bollengier Date: Mon, 21 Aug 2006 15:24:12 +0000 (+0000) Subject: mco fix bug when StartFile != EndFile X-Git-Tag: Release-2.0.0~587 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=13a527fe086eb6d036785fc1f9884da9afe10b94;p=bacula%2Fbacula mco fix bug when StartFile != EndFile git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3324 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/gui/brestore/brestore.pl b/gui/brestore/brestore.pl index fbe56b1e44..4325e1f2af 100755 --- a/gui/brestore/brestore.pl +++ b/gui/brestore/brestore.pl @@ -2225,15 +2225,15 @@ sub create_filelist my $dbh = $self->{dbh}; my %mediainfos; # This query gets all jobid/jobmedia/media combination. - my $query = -"SELECT Job.JobId, Job.VolsessionId, Job.VolsessionTime, JobMedia.StartFile, - JobMedia.FirstIndex, JobMedia.LastIndex, JobMedia.StartBlock, - JobMedia.EndBlock, JobMedia.VolIndex, Media.Volumename, Media.MediaType - FROM Job, JobMedia, Media - WHERE Job.JobId = JobMedia.JobId - AND JobMedia.MediaId = Media.MediaId - AND JobMedia.StartFile = JobMedia.EndFile - ORDER BY JobMedia.FirstIndex, JobMedia.LastIndex"; + my $query = " +SELECT Job.JobId, Job.VolsessionId, Job.VolsessionTime, JobMedia.StartFile, + JobMedia.EndFile, JobMedia.FirstIndex, JobMedia.LastIndex, + JobMedia.StartBlock, JobMedia.EndBlock, JobMedia.VolIndex, + Media.Volumename, Media.MediaType +FROM Job, JobMedia, Media +WHERE Job.JobId = JobMedia.JobId + AND JobMedia.MediaId = Media.MediaId + ORDER BY JobMedia.FirstIndex, JobMedia.LastIndex"; my $result = $dbh->selectall_arrayref($query); @@ -2242,10 +2242,16 @@ sub create_filelist foreach my $refrow (@$result) { - my ($jobid, $volsessionid, $volsessiontime, $startfile, + my ($jobid, $volsessionid, $volsessiontime, $startfile, $endfile, $firstindex, $lastindex, $startblock, $endblock, $volindex, $volumename, $mediatype) = @{$refrow}; + # We just have to deal with the case where starfile != endfile + # In this case, we concatenate both, for the bsr + if ($startfile != $endfile) { + $startfile = $startfile . '-' . $endfile; + } + my @tmparray = ($jobid, $volsessionid, $volsessiontime, $startfile, $firstindex, $lastindex, $startblock .'-'. $endblock,