From: <ri...@us...> - 2007-02-07 16:52:18
|
Revision: 4138 http://bacula.svn.sourceforge.net/bacula/?rev=4138&view=rev Author: ricozz Date: 2007-02-07 08:52:19 -0800 (Wed, 07 Feb 2007) Log Message: ----------- ebl Add ClientId in db_create_job_record It's usefull for bweb, we have always a client id with a Job Modified Paths: -------------- trunk/bacula/src/cats/sql_create.c trunk/bacula/src/dird/job.c Modified: trunk/bacula/src/cats/sql_create.c =================================================================== --- trunk/bacula/src/cats/sql_create.c 2007-02-07 16:45:38 UTC (rev 4137) +++ trunk/bacula/src/cats/sql_create.c 2007-02-07 16:52:19 UTC (rev 4138) @@ -70,7 +70,7 @@ struct tm tm; bool ok; utime_t JobTDate; - char ed1[30]; + char ed1[30],ed2[30]; db_lock(mdb); @@ -83,10 +83,11 @@ /* Must create it */ Mmsg(mdb->cmd, -"INSERT INTO Job (Job,Name,Type,Level,JobStatus,SchedTime,JobTDate) VALUES " -"('%s','%s','%c','%c','%c','%s',%s)", +"INSERT INTO Job (Job,Name,Type,Level,JobStatus,SchedTime,JobTDate,ClientId) " +"VALUES ('%s','%s','%c','%c','%c','%s',%s,%s)", jr->Job, jr->Name, (char)(jr->JobType), (char)(jr->JobLevel), - (char)(jr->JobStatus), dt, edit_uint64(JobTDate, ed1)); + (char)(jr->JobStatus), dt, edit_uint64(JobTDate, ed1), + edit_int64(jr->ClientId, ed2)); if (!INSERT_DB(jcr, mdb, mdb->cmd)) { Mmsg2(&mdb->errmsg, _("Create DB Job record %s failed. ERR=%s\n"), Modified: trunk/bacula/src/dird/job.c =================================================================== --- trunk/bacula/src/dird/job.c 2007-02-07 16:45:38 UTC (rev 4137) +++ trunk/bacula/src/dird/job.c 2007-02-07 16:52:19 UTC (rev 4138) @@ -156,6 +156,10 @@ * Create Job record */ init_jcr_job_record(jcr); + if (!get_or_create_client_record(jcr)) { + goto bail_out; + } + if (!db_create_job_record(jcr, jcr->db, &jcr->jr)) { Jmsg(jcr, M_FATAL, 0, "%s", db_strerror(jcr->db)); goto bail_out; @@ -164,10 +168,6 @@ Dmsg4(100, "Created job record JobId=%d Name=%s Type=%c Level=%c\n", jcr->JobId, jcr->Job, jcr->jr.JobType, jcr->jr.JobLevel); - if (!get_or_create_client_record(jcr)) { - goto bail_out; - } - generate_daemon_event(jcr, "JobStart"); if (job_canceled(jcr)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |