const char *sql_jobids_from_mediaid =
"SELECT DISTINCT Job.JobId,Job.StartTime FROM JobMedia,Job"
" WHERE JobMedia.JobId=Job.JobId AND JobMedia.MediaId IN (%s)"
- " AND Job.Type='B'"
+ " AND Job.Type='B' AND Job.JobStatus = 'T'"
" ORDER by Job.StartTime";
/* Get the number of bytes in the pool */
" (SELECT DISTINCT Job.JobId from Pool,Job,Media,JobMedia WHERE"
" Pool.Name='%s' AND Media.PoolId=Pool.PoolId AND"
" VolStatus in ('Full','Used','Error','Append') AND Media.Enabled=1 AND"
- " Job.Type='B' AND"
+ " Job.Type='B' AND Job.JobStatus = 'T' AND"
" JobMedia.JobId=Job.JobId AND Job.PoolId=Media.PoolId)";
#ifdef xxx
"SELECT DISTINCT Job.JobId FROM Pool,Job,Media,JobMedia WHERE"
" Pool.Name='%s' AND Media.PoolId=Pool.PoolId AND"
" VolStatus in ('Full','Used','Error') AND Media.Enabled=1 AND"
- " Job.Type='B' AND"
+ " Job.Type='B' AND Job.JobStatus = 'T' AND"
" JobMedia.JobId=Job.JobId AND Job.PoolId=Media.PoolId"
" AND Job.RealEndTime<='%s'";
General:
08Oct08
+kes Fix migration SQL not to migrate a job that has not terminated.
+ This is a partial fix to bug #1164.
kes Sort JobIds returned from db_accurate_get_jobids() to fix Virtual
backup start time bug reported by Graham Keeling.
08Oct08