From: Eric Bollengier Date: Wed, 16 Jun 2010 12:48:48 +0000 (+0200) Subject: Improve the "update stats" sql command X-Git-Tag: Release-7.0.0~1758 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3980a53dce47b0f14bca61082b762323ab2cdf12;p=bacula%2Fbacula Improve the "update stats" sql command --- diff --git a/bacula/src/cats/sql_cmds.c b/bacula/src/cats/sql_cmds.c index dbcdb6d559..e29a055d8c 100644 --- a/bacula/src/cats/sql_cmds.c +++ b/bacula/src/cats/sql_cmds.c @@ -63,7 +63,9 @@ const char *fill_jobhisto = "PurgedFiles, HasBase, Reviewed, Comment " "FROM Job " "WHERE JobStatus IN ('T','W','f','A','E') " - "AND JobId NOT IN (SELECT JobId FROM JobHisto) " + "AND NOT EXISTS " + "(SELECT JobHisto.JobId " + "FROM JobHisto WHERE JobHisto.Jobid=Job.JobId) " "AND JobTDate < %s "; /* For ua_update.c */