]> git.sur5r.net Git - bacula/bacula/commitdiff
update HasBase in catalog
authorEric Bollengier <eric@eb.homelinux.org>
Wed, 29 Jul 2009 20:39:09 +0000 (22:39 +0200)
committerEric Bollengier <eric@eb.homelinux.org>
Mon, 3 Aug 2009 14:39:18 +0000 (16:39 +0200)
bacula/src/cats/sql_get.c
bacula/src/cats/sql_update.c
bacula/src/dird/backup.c
bacula/src/dird/job.c
bacula/src/jcr.h

index 6ebda1b80b2e6f593fd58a6438e691eaa2d525fc..60db400f457da0c2c434befdd7b868366a341812 100644 (file)
@@ -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);
index e659a18813b4c92083ec570d4fc20c14d7ea579e..c7413850bbb3fda2b30d1aa27fb1a32dd2ae2463 100644 (file)
@@ -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);
 
index cbb003f452d87c027eda6a82ff0b766cb8cd21c6..d76c0d9a41d39694a2a99048e9ef3859caa80f82 100644 (file)
@@ -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 */
index 6a11f9d389cc8e929bd3527274bf9989981f8282..0945c053e2674a5b80ef77fb1294abd20d5ed14d 100644 (file)
@@ -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));
index 151a5224cf7ced2ab4e91424d914b259bf7b0059..36c72b4a6211df5c4d74df5d900e5bafe9767b93 100644 (file)
@@ -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 */