bool BDB::bdb_create_job_record(JCR *jcr, JOB_DBR *jr)
{
POOL_MEM buf;
- char dt[MAX_TIME_LENGTH];
- time_t stime;
+ char dt[MAX_TIME_LENGTH], dt2[MAX_TIME_LENGTH];
+ time_t stime, starttime;
struct tm tm;
bool ok;
int len;
bdb_lock();
stime = jr->SchedTime;
+ starttime = jr->StartTime;
ASSERT(stime != 0);
(void)localtime_r(&stime, &tm);
strftime(dt, sizeof(dt), "%Y-%m-%d %H:%M:%S", &tm);
+
+ (void)localtime_r(&starttime, &tm);
+ strftime(dt2, sizeof(dt2), "%Y-%m-%d %H:%M:%S", &tm);
JobTDate = (utime_t)stime;
len = strlen(jcr->comment); /* TODO: use jr instead of jcr to get comment */
/* Must create it */
Mmsg(cmd,
-"INSERT INTO Job (Job,Name,Type,Level,JobStatus,SchedTime,JobTDate,"
+"INSERT INTO Job (Job,Name,Type,Level,JobStatus,StartTime,SchedTime,JobTDate,"
"ClientId,Comment) "
-"VALUES ('%s','%s','%c','%c','%c','%s',%s,%s,'%s')",
+"VALUES ('%s','%s','%c','%c','%c','%s','%s',%s,%s,'%s')",
esc_job, esc_name, (char)(jr->JobType), (char)(jr->JobLevel),
- (char)(jr->JobStatus), dt, edit_uint64(JobTDate, ed1),
+ (char)(jr->JobStatus), dt2, dt, edit_uint64(JobTDate, ed1),
edit_int64(jr->ClientId, ed2), buf.c_str());
if ((jr->JobId = sql_insert_autokey_record(cmd, NT_("Job"))) == 0) {