]> git.sur5r.net Git - bacula/bacula/commitdiff
Improve the "update stats" sql command
authorEric Bollengier <eric@eb.homelinux.org>
Wed, 16 Jun 2010 12:48:48 +0000 (14:48 +0200)
committerEric Bollengier <eric@eb.homelinux.org>
Mon, 2 Aug 2010 14:53:53 +0000 (16:53 +0200)
bacula/src/cats/sql_cmds.c

index dbcdb6d55924bd6b2c3430f35630820933ff4046..e29a055d8c6ee67297a7b5e719879b8c16ca7e41 100644 (file)
@@ -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 */