From: Eric Bollengier Date: Wed, 29 Jul 2009 20:39:09 +0000 (+0200) Subject: update HasBase in catalog X-Git-Tag: Release-7.0.0~2684 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4324a15e7c632ccf53ec19fa393c91a552f90a09;p=bacula%2Fbacula update HasBase in catalog --- diff --git a/bacula/src/cats/sql_get.c b/bacula/src/cats/sql_get.c index 6ebda1b80b..60db400f45 100644 --- a/bacula/src/cats/sql_get.c +++ b/bacula/src/cats/sql_get.c @@ -297,13 +297,13 @@ bool db_get_job_record(JCR *jcr, B_DB *mdb, JOB_DBR *jr) Mmsg(mdb->cmd, "SELECT VolSessionId,VolSessionTime," "PoolId,StartTime,EndTime,JobFiles,JobBytes,JobTDate,Job,JobStatus," "Type,Level,ClientId,Name,PriorJobId,RealEndTime,JobId,FileSetId," -"SchedTime,RealEndTime,ReadBytes " +"SchedTime,RealEndTime,ReadBytes,HasBase " "FROM Job WHERE Job='%s'", jr->Job); } else { Mmsg(mdb->cmd, "SELECT VolSessionId,VolSessionTime," "PoolId,StartTime,EndTime,JobFiles,JobBytes,JobTDate,Job,JobStatus," "Type,Level,ClientId,Name,PriorJobId,RealEndTime,JobId,FileSetId," -"SchedTime,RealEndTime,ReadBytes " +"SchedTime,RealEndTime,ReadBytes,HasBase " "FROM Job WHERE JobId=%s", edit_int64(jr->JobId, ed1)); } @@ -346,6 +346,7 @@ bool db_get_job_record(JCR *jcr, B_DB *mdb, JOB_DBR *jr) jr->SchedTime = str_to_utime(jr->cSchedTime); jr->EndTime = str_to_utime(jr->cEndTime); jr->RealEndTime = str_to_utime(jr->cRealEndTime); + jr->HasBase = str_to_int64(row[21]); sql_free_result(mdb); db_unlock(mdb); diff --git a/bacula/src/cats/sql_update.c b/bacula/src/cats/sql_update.c index e659a18813..c7413850bb 100644 --- a/bacula/src/cats/sql_update.c +++ b/bacula/src/cats/sql_update.c @@ -184,14 +184,15 @@ db_update_job_end_record(JCR *jcr, B_DB *mdb, JOB_DBR *jr) "UPDATE Job SET JobStatus='%c',EndTime='%s'," "ClientId=%u,JobBytes=%s,ReadBytes=%s,JobFiles=%u,JobErrors=%u,VolSessionId=%u," "VolSessionTime=%u,PoolId=%u,FileSetId=%u,JobTDate=%s," -"RealEndTime='%s',PriorJobId=%s WHERE JobId=%s", +"RealEndTime='%s',PriorJobId=%s,HasBase=%u WHERE JobId=%s", (char)(jr->JobStatus), dt, jr->ClientId, edit_uint64(jr->JobBytes, ed1), edit_uint64(jr->ReadBytes, ed4), jr->JobFiles, jr->JobErrors, jr->VolSessionId, jr->VolSessionTime, jr->PoolId, jr->FileSetId, edit_uint64(JobTDate, ed2), rdt, PriorJobId, - edit_int64(jr->JobId, ed3)); + edit_int64(jr->JobId, ed3), + jr->HasBase); stat = UPDATE_DB(jcr, mdb, mdb->cmd); diff --git a/bacula/src/dird/backup.c b/bacula/src/dird/backup.c index cbb003f452..d76c0d9a41 100644 --- a/bacula/src/dird/backup.c +++ b/bacula/src/dird/backup.c @@ -183,6 +183,7 @@ bool send_accurate_current_files(JCR *jcr) goto bail_out; } db_create_base_file_list(jcr, jcr->db, jobids); + jcr->HasBase = true; } else { /* For Incr/Diff level, we search for older jobs */ diff --git a/bacula/src/dird/job.c b/bacula/src/dird/job.c index 6a11f9d389..0945c053e2 100644 --- a/bacula/src/dird/job.c +++ b/bacula/src/dird/job.c @@ -875,6 +875,7 @@ void update_job_end_record(JCR *jcr) jcr->jr.VolSessionId = jcr->VolSessionId; jcr->jr.VolSessionTime = jcr->VolSessionTime; jcr->jr.JobErrors = jcr->JobErrors; + jcr->jr.HasBase = jcr->HasBase; if (!db_update_job_end_record(jcr, jcr->db, &jcr->jr)) { Jmsg(jcr, M_WARNING, 0, _("Error updating job record. %s"), db_strerror(jcr->db)); diff --git a/bacula/src/jcr.h b/bacula/src/jcr.h index 151a5224cf..36c72b4a62 100644 --- a/bacula/src/jcr.h +++ b/bacula/src/jcr.h @@ -337,6 +337,7 @@ public: bool stats_enabled; /* Keep all job records in a table for long term statistics */ bool no_maxtime; /* Don't check Max*Time for this JCR */ bool keep_sd_auth_key; /* Clear or not the SD auth key after connection*/ + bool HasBase; /* True if job use base jobs */ #endif /* DIRECTOR_DAEMON */