From 0725b832598bcec739761a5eee6c05ec0062b47e Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Thu, 17 Sep 2009 14:53:51 +0200 Subject: [PATCH] Cleanup, change FROM order --- bacula/src/cats/sql_cmds.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/bacula/src/cats/sql_cmds.c b/bacula/src/cats/sql_cmds.c index a806bedee5..e58c6a5e1e 100644 --- a/bacula/src/cats/sql_cmds.c +++ b/bacula/src/cats/sql_cmds.c @@ -454,7 +454,7 @@ const char *uar_jobid_fileindex_from_table = const char *select_recent_version_with_basejob[4] = { /* MySQL */ "SELECT FileId, Job.JobId, FileIndex, File.PathId, File.FilenameId, LStat, MD5 " -"FROM ( " +"FROM Job, File, ( " "SELECT MAX(JobTDate) AS JobTDate, PathId, FilenameId " "FROM ( " "SELECT JobTDate, PathId, FilenameId " @@ -468,7 +468,6 @@ const char *select_recent_version_with_basejob[4] = { "WHERE BaseFiles.JobId IN (%s) " ") AS temp GROUP BY PathId, FilenameId " ") AS T1 " - "Job, File, " "WHERE Job.JobId IN (%s) " "AND Job.JobTDate = T1.JobTDate " "AND File.PathId = T1.PathId " @@ -490,7 +489,7 @@ const char *select_recent_version_with_basejob[4] = { /* SQLite */ "SELECT FileId, Job.JobId, FileIndex, File.PathId, File.FilenameId, LStat, MD5 " -"FROM ( " +"FROM Job, File, ( " "SELECT MAX(JobTDate) AS JobTDate, PathId, FilenameId " "FROM ( " "SELECT JobTDate, PathId, FilenameId " @@ -503,8 +502,7 @@ const char *select_recent_version_with_basejob[4] = { "JOIN Job ON (BaseJobId = Job.JobId) " "WHERE BaseFiles.JobId IN (%s) " ") AS temp GROUP BY PathId, FilenameId " - ") AS T1, " - "Job, File " + ") AS T1 " "WHERE Job.JobId IN (%s) " "AND Job.JobTDate = T1.JobTDate " "AND File.PathId = T1.PathId " @@ -512,7 +510,7 @@ const char *select_recent_version_with_basejob[4] = { /* SQLite3 */ "SELECT FileId, Job.JobId, FileIndex, File.PathId, File.FilenameId, LStat, MD5 " -"FROM ( " +"FROM Job, File, ( " "SELECT MAX(JobTDate) AS JobTDate, PathId, FilenameId " "FROM ( " "SELECT JobTDate, PathId, FilenameId " @@ -525,8 +523,7 @@ const char *select_recent_version_with_basejob[4] = { "JOIN Job ON (BaseJobId = Job.JobId) " "WHERE BaseFiles.JobId IN (%s) " ") AS temp GROUP BY PathId, FilenameId " - ") AS T1, " - "Job, File " + ") AS T1 " "WHERE Job.JobId IN (%s) " "AND Job.JobTDate = T1.JobTDate " "AND File.PathId = T1.PathId " -- 2.39.5