From: Eric Bollengier Date: Wed, 16 Jun 2010 12:48:48 +0000 (+0200) Subject: Improve the "update stats" sql command X-Git-Tag: Release-5.2.1~1293 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=81a696805893843dc96b67eb8d0643ca58047b36;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 */