]> git.sur5r.net Git - bacula/bacula/commitdiff
mco fix bug when StartFile != EndFile
authorEric Bollengier <eric@eb.homelinux.org>
Mon, 21 Aug 2006 15:24:12 +0000 (15:24 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Mon, 21 Aug 2006 15:24:12 +0000 (15:24 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3324 91ce42f0-d328-0410-95d8-f526ca767f89

gui/brestore/brestore.pl

index fbe56b1e448452571888514d1a19a40fadc7669b..4325e1f2af3c2096c082f435610770f11b8b55a9 100755 (executable)
@@ -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,