]> git.sur5r.net Git - bacula/bacula/commitdiff
The "DISTINCT" keyword seems to be required if the joins for jobmedia
authorDirk H Bartley <dbartley@schupan.com>
Mon, 17 Dec 2007 20:30:45 +0000 (20:30 +0000)
committerDirk H Bartley <dbartley@schupan.com>
Mon, 17 Dec 2007 20:30:45 +0000 (20:30 +0000)
and media exist

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6068 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/qt-console/joblist/joblist.cpp

index 67d5e084b4bb5df7d33776753927e2994887e26b..4664cd552cbd975cf58e3b3f049b178c1635d95a 100644 (file)
@@ -154,7 +154,9 @@ void JobList::populateTable()
    int volumeIndex = volumeComboBox->currentIndex();
    if (volumeIndex != -1)
       m_mediaName = volumeComboBox->itemText(volumeIndex);
-   query += "SELECT Job.Jobid AS Id, Job.Name AS JobName, " 
+   QString distinct = "";
+   if (m_mediaName != "Any") { distinct = "DISTINCT "; }
+   query += "SELECT " + distinct + "Job.Jobid AS Id, Job.Name AS JobName, " 
             " Client.Name AS Client,"
             " Job.Starttime AS JobStart, Job.Type AS JobType,"
             " Job.Level AS BackupLevel, Job.Jobfiles AS FileCount,"