From b1635f5884e30773e1bc28db1c771eed5b29a9cb Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Thu, 17 Sep 2009 16:32:40 +0200 Subject: [PATCH] Restore comments --- bacula/src/cats/sql_cmds.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bacula/src/cats/sql_cmds.c b/bacula/src/cats/sql_cmds.c index 5017e878ca..cc92f5f4f1 100644 --- a/bacula/src/cats/sql_cmds.c +++ b/bacula/src/cats/sql_cmds.c @@ -467,22 +467,22 @@ const char *select_recent_version_with_basejob[4] = { "FROM Job, File, ( " "SELECT MAX(JobTDate) AS JobTDate, PathId, FilenameId " "FROM ( " - "SELECT JobTDate, PathId, FilenameId " - "FROM File JOIN Job USING (JobId) " + "SELECT JobTDate, PathId, FilenameId " /* Get all normal files */ + "FROM File JOIN Job USING (JobId) " /* from selected backup */ "WHERE JobId IN (%s) " "UNION ALL " - "SELECT JobTDate, PathId, FilenameId " - "FROM BaseFiles " + "SELECT JobTDate, PathId, FilenameId " /* Get all files from */ + "FROM BaseFiles " /* BaseJob */ "JOIN File USING (FileId) " "JOIN Job ON (BaseJobId = Job.JobId) " - "WHERE BaseFiles.JobId IN (%s) " - ") AS tmp GROUP BY PathId, FilenameId " + "WHERE BaseFiles.JobId IN (%s) " /* Use Max(JobTDate) to find */ + ") AS tmp GROUP BY PathId, FilenameId " /* the latest file version */ ") AS T1 " -"WHERE (Job.JobId IN ( " +"WHERE (Job.JobId IN ( " /* Security, we force JobId to be valid */ "SELECT DISTINCT BaseJobId FROM BaseFiles WHERE JobId IN (%s)) " "OR Job.JobId IN (%s)) " - "AND T1.JobTDate = Job.JobTDate " - "AND Job.JobId = File.JobId " + "AND T1.JobTDate = Job.JobTDate " /* Join on JobTDate to get the orginal */ + "AND Job.JobId = File.JobId " /* Job/File record */ "AND T1.PathId = File.PathId " "AND T1.FilenameId = File.FilenameId", -- 2.39.5