From: Eric Bollengier Date: Wed, 11 Nov 2009 12:40:03 +0000 (+0100) Subject: Tweak base file query for Mysql 4.1 X-Git-Tag: Release-5.0.0~268 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6b2146616d3eab7c73620de06582b7395e459403;p=bacula%2Fbacula Tweak base file query for Mysql 4.1 --- diff --git a/bacula/src/cats/sql_cmds.c b/bacula/src/cats/sql_cmds.c index 5f36968581..9dd7a2bdac 100644 --- a/bacula/src/cats/sql_cmds.c +++ b/bacula/src/cats/sql_cmds.c @@ -469,7 +469,7 @@ const char *select_recent_version_with_basejob[4] = { "FROM ( " "SELECT JobTDate, PathId, FilenameId " /* Get all normal files */ "FROM File JOIN Job USING (JobId) " /* from selected backup */ - "WHERE JobId IN (%s) " + "WHERE File.JobId IN (%s) " "UNION ALL " "SELECT JobTDate, PathId, FilenameId " /* Get all files from */ "FROM BaseFiles " /* BaseJob */ @@ -508,7 +508,7 @@ const char *select_recent_version_with_basejob[4] = { "FROM ( " "SELECT JobTDate, PathId, FilenameId " "FROM File JOIN Job USING (JobId) " - "WHERE JobId IN (%s) " + "WHERE File.JobId IN (%s) " "UNION ALL " "SELECT JobTDate, PathId, FilenameId " "FROM BaseFiles " @@ -533,7 +533,7 @@ const char *select_recent_version_with_basejob[4] = { "FROM ( " "SELECT JobTDate, PathId, FilenameId " "FROM File JOIN Job USING (JobId) " - "WHERE JobId IN (%s) " + "WHERE File.JobId IN (%s) " "UNION ALL " "SELECT JobTDate, PathId, FilenameId " "FROM BaseFiles " @@ -560,7 +560,7 @@ const char *select_recent_version[4] = { "FROM ( " /* Choose the last version for each Path/Filename */ "SELECT max(JobTDate) AS JobTDate, PathId, FilenameId " "FROM File JOIN Job USING (JobId) " - "WHERE JobId IN (%s) " + "WHERE File.JobId IN (%s) " "GROUP BY PathId, FilenameId " ") AS t1, Job AS j1, File AS f1 " "WHERE t1.JobTDate = j1.JobTDate " @@ -583,7 +583,7 @@ const char *select_recent_version[4] = { "FROM ( " "SELECT max(JobTDate) AS JobTDate, PathId, FilenameId " "FROM File JOIN Job USING (JobId) " - "WHERE JobId IN (%s) " + "WHERE File.JobId IN (%s) " "GROUP BY PathId, FilenameId " ") AS t1, Job AS j1, File AS f1 " "WHERE t1.JobTDate = j1.JobTDate " @@ -599,7 +599,7 @@ const char *select_recent_version[4] = { "FROM ( " "SELECT max(JobTDate) AS JobTDate, PathId, FilenameId " "FROM File JOIN Job USING (JobId) " - "WHERE JobId IN (%s) " + "WHERE File.JobId IN (%s) " "GROUP BY PathId, FilenameId " ") AS t1, Job AS j1, File AS f1 " "WHERE t1.JobTDate = j1.JobTDate "