]> git.sur5r.net Git - bacula/bacula/commitdiff
Remove RestoreObjects when pruning Jobs
authorKern Sibbald <kern@sibbald.com>
Sat, 1 May 2010 08:59:06 +0000 (10:59 +0200)
committerEric Bollengier <eric@eb.homelinux.org>
Mon, 2 Aug 2010 14:53:46 +0000 (16:53 +0200)
bacula/src/dird/ua_purge.c

index 539586d443cfa77b1b3df9eef3e8834f08f92433..ff9c7df4d25a5cc3ec408be5a67ec7b823f629cc 100644 (file)
@@ -423,6 +423,11 @@ void purge_jobs_from_catalog(UAContext *ua, char *jobs)
    db_sql_query(ua->db, query.c_str(), NULL, (void *)NULL);
    Dmsg1(050, "Delete Log sql=%s\n", query.c_str());
 
+   Mmsg(query, "DELETE FROM RestoreObject WHERE JobId IN (%s)", jobs);
+   db_sql_query(ua->db, query.c_str(), NULL, (void *)NULL);
+   Dmsg1(050, "Delete RestoreObject sql=%s\n", query.c_str());
+
+
    upgrade_copies(ua, jobs);
 
    /* Now remove the Job record itself */