From a50ee873d456dc6f1fa691f5343c86b344839b45 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sat, 6 Mar 2010 14:57:20 +0100 Subject: [PATCH] Second correct fix to bug #1524 verify fails after adding or removing files --- bacula/src/cats/sql_get.c | 13 ------------- bacula/src/dird/verify.c | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/bacula/src/cats/sql_get.c b/bacula/src/cats/sql_get.c index 2aa397dbdb..540921ef08 100644 --- a/bacula/src/cats/sql_get.c +++ b/bacula/src/cats/sql_get.c @@ -125,19 +125,6 @@ int db_get_file_record(JCR *jcr, B_DB *mdb, JOB_DBR *jr, FILE_DBR *fdbr) edit_int64(fdbr->PathId, ed1), edit_int64(fdbr->FilenameId, ed2), edit_int64(jr->ClientId,ed3)); - - } else if (jr != NULL) { - /* - * Note, if jr given jr->FileIndex must be valid - * This is probably no longer used. - */ - Mmsg(mdb->cmd, -"SELECT FileId, LStat, MD5 FROM File WHERE File.JobId=%s AND File.PathId=%s AND " -"File.FilenameId=%s AND FileIndex=%u", - edit_int64(fdbr->JobId, ed1), - edit_int64(fdbr->PathId, ed2), - edit_int64(fdbr->FilenameId,ed3), - jr->FileIndex); } else { Mmsg(mdb->cmd, "SELECT FileId, LStat, MD5 FROM File WHERE File.JobId=%s AND File.PathId=%s AND " diff --git a/bacula/src/dird/verify.c b/bacula/src/dird/verify.c index b810f139c0..d288aa2377 100644 --- a/bacula/src/dird/verify.c +++ b/bacula/src/dird/verify.c @@ -603,7 +603,7 @@ void get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t JobId) */ fdbr.FileId = 0; if (!db_get_file_attributes_record(jcr, jcr->db, jcr->fname, - NULL, &fdbr)) { + &jcr->previous_jr, &fdbr)) { Jmsg(jcr, M_INFO, 0, _("New file: %s\n"), jcr->fname); Dmsg1(020, _("File not in catalog: %s\n"), jcr->fname); set_jcr_job_status(jcr, JS_Differences); -- 2.39.5