]> git.sur5r.net Git - bacula/bacula/commitdiff
kes Return JobId in db_get_job_record() when JobId==0. This should
authorKern Sibbald <kern@sibbald.com>
Fri, 12 Jan 2007 11:03:27 +0000 (11:03 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 12 Jan 2007 11:03:27 +0000 (11:03 +0000)
     fix bug #741.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.0@3985 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/cats/sql_get.c
bacula/technotes-2.0

index a3461c6cdb369fb714f2cb5f68bf8fbc0b398ae2..b2cc9734e52dff82897b9ad6428e250842bd20f7 100644 (file)
@@ -11,7 +11,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -275,12 +275,12 @@ bool db_get_job_record(JCR *jcr, B_DB *mdb, JOB_DBR *jr)
    if (jr->JobId == 0) {
       Mmsg(mdb->cmd, "SELECT VolSessionId,VolSessionTime,"
 "PoolId,StartTime,EndTime,JobFiles,JobBytes,JobTDate,Job,JobStatus,"
-"Type,Level,ClientId,Name,PriorJobId,RealEndTime "
+"Type,Level,ClientId,Name,PriorJobId,RealEndTime,JobId "
 "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 "
+"Type,Level,ClientId,Name,PriorJobId,RealEndTime,JobId "
 "FROM Job WHERE JobId=%s", 
           edit_int64(jr->JobId, ed1));
     }
@@ -312,6 +312,9 @@ bool db_get_job_record(JCR *jcr, B_DB *mdb, JOB_DBR *jr)
    bstrncpy(jr->Name, row[13]!=NULL?row[13]:"", sizeof(jr->Name));
    jr->PriorJobId = str_to_uint64(row[14]!=NULL?row[14]:(char *)"");
    bstrncpy(jr->cRealEndTime, row[15]!=NULL?row[15]:"", sizeof(jr->cRealEndTime));
+   if (jr->JobId == 0) {
+      jr->JobId = str_to_int64(row[16]);
+   }
    sql_free_result(mdb);
 
    db_unlock(mdb);
index 79f5f5232ea76603358417c0e70380b467575f70..6939350b0b50609832d5d04c4dc26c2c6f6576ce 100644 (file)
@@ -3,6 +3,8 @@
 General:
 Version 2.0.1
 12Jan07
+kes  Return JobId in db_get_job_record() when JobId==0. This should
+     fix bug #741.
 kes  Do not release source pointers when restarting a failed job.
 11Jan07
 kes  Add dynamic dll entry point for SHGetFolderPath to Win32 code.