"WHERE (Job.JobId IN ( "
"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 Job.JobTDate = T1.JobTDate "
- "AND File.PathId = T1.PathId "
- "AND File.FilenameId = T1.PathId "
+ "AND T1.PathId = File.PathId "
+ "AND T1.FilenameId = File.FilenameId",
/* Postgresql */ /* The DISTINCT ON () permits to avoid extra join */
"SELECT DISTINCT ON (FilenameId, PathId) StartTime, JobId, FileId, "
"WHERE (Job.JobId IN ( "
"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 Job.JobTDate = T1.JobTDate "
- "AND File.PathId = T1.PathId "
- "AND File.FilenameId = T1.PathId ",
+ "AND T1.PathId = File.PathId "
+ "AND T1.FilenameId = File.FilenameId",
/* SQLite3 */ /* See Mysql section for doc */
"SELECT FileId, Job.JobId AS JobId, FileIndex, File.PathId AS PathId, "
"WHERE (Job.JobId IN ( "
"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 Job.JobTDate = T1.JobTDate "
- "AND File.PathId = T1.PathId "
- "AND File.FilenameId = T1.PathId "
+ "AND T1.PathId = File.PathId "
+ "AND T1.FilenameId = File.FilenameId"
};
/* Get the list of the last recent version with a given BaseJob jobid list */
#define new_db_get_file_list
#ifdef new_db_get_file_list
POOL_MEM buf2(PM_MESSAGE);
+ Dmsg1(0, "sql=%s\n", select_recent_version_with_basejob[db_type]);
Mmsg(buf2, select_recent_version_with_basejob[db_type],
- jobids, jobids, jobids);
+ jobids, jobids, jobids, jobids);
+ Dmsg1(0, "sql=%s\n", buf2.c_str());
Mmsg(buf,
"SELECT Path.Path, Filename.Name, Temp.FileIndex, Temp.JobId, LStat, MD5 "
"FROM ( %s ) AS Temp "
bstat=2
fi
-ls -l ${cwd}/tmp/bacula-restores/tmp/regress/build/accurate/
-
################################################################
p Now do a backup after making few changes
################################################################
check_restore_diff
check_files_written ${cwd}/tmp/log1.out 4
-ls -l ${cwd}/tmp/bacula-restores/tmp/regress/build/accurate/
-
-exit 0
-
rm -rf ${cwd}/tmp/bacula-restores
################################################################