From: Eric Bollengier Date: Thu, 16 Aug 2012 09:30:00 +0000 (+0200) Subject: Fix #1923 about MySQL 4 support for BVFS X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a5d9807c4316f1567b86c1c1c8dbcfe2bf847bd2;p=bacula%2Fbacula Fix #1923 about MySQL 4 support for BVFS --- diff --git a/bacula/src/cats/bvfs.c b/bacula/src/cats/bvfs.c index c2b08d6991..10b283e66d 100644 --- a/bacula/src/cats/bvfs.c +++ b/bacula/src/cats/bvfs.c @@ -914,8 +914,9 @@ bool Bvfs::compute_restore_list(char *fileid, char *dirid, char *hardlink, if (*fileid) { /* Select files with their direct id */ init=true; - Mmsg(tmp,"SELECT JobId, JobTDate, FileIndex, FilenameId, PathId, FileId " - "FROM File JOIN Job USING (JobId) WHERE FileId IN (%s)", + Mmsg(tmp,"SELECT Job.JobId, JobTDate, FileIndex, FilenameId, " + "PathId, FileId " + "FROM File JOIN Job USING (JobId) WHERE FileId IN (%s)", fileid); pm_strcat(query, tmp.c_str()); } @@ -956,7 +957,7 @@ bool Bvfs::compute_restore_list(char *fileid, char *dirid, char *hardlink, query.strcat(" UNION "); } - Mmsg(tmp, "SELECT JobId, JobTDate, File.FileIndex, File.FilenameId, " + Mmsg(tmp, "SELECT Job.JobId, JobTDate, File.FileIndex, File.FilenameId, " "File.PathId, FileId " "FROM Path JOIN File USING (PathId) JOIN Job USING (JobId) " "WHERE Path.Path LIKE '%s' AND File.JobId IN (%s) ", @@ -994,7 +995,7 @@ bool Bvfs::compute_restore_list(char *fileid, char *dirid, char *hardlink, tmp.strcat(") UNION "); query.strcat(tmp.c_str()); } - Mmsg(tmp, "SELECT JobId, JobTDate, FileIndex, FilenameId, " + Mmsg(tmp, "SELECT Job.JobId, JobTDate, FileIndex, FilenameId, " "PathId, FileId " "FROM File JOIN Job USING (JobId) WHERE JobId = %lld " "AND FileIndex IN (%lld", jobid, id); diff --git a/bacula/src/cats/sql_cmds.c b/bacula/src/cats/sql_cmds.c index 4958c17d2f..b60be1f96f 100644 --- a/bacula/src/cats/sql_cmds.c +++ b/bacula/src/cats/sql_cmds.c @@ -221,7 +221,7 @@ const char *uar_sel_fileset = * use Ids to select the FileSet name. (like in accurate) */ const char *uar_sel_filesetid = - "SELECT MAX(FileSetId) " + "SELECT MAX(FileSet.FileSetId) " "FROM FileSet JOIN Job USING (FileSetId) " "WHERE Job.ClientId=%s " "GROUP BY FileSet";