From: Kern Sibbald Date: Fri, 12 Jan 2007 11:03:27 +0000 (+0000) Subject: kes Return JobId in db_get_job_record() when JobId==0. This should X-Git-Tag: Release-2.0.3~60 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b37383bcd2bee3e16e27a16068d8378d17224c71;p=bacula%2Fbacula kes Return JobId in db_get_job_record() when JobId==0. This should fix bug #741. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.0@3985 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/cats/sql_get.c b/bacula/src/cats/sql_get.c index a3461c6cdb..b2cc9734e5 100644 --- a/bacula/src/cats/sql_get.c +++ b/bacula/src/cats/sql_get.c @@ -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); diff --git a/bacula/technotes-2.0 b/bacula/technotes-2.0 index 79f5f5232e..6939350b0b 100644 --- a/bacula/technotes-2.0 +++ b/bacula/technotes-2.0 @@ -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.