From: Eric Bollengier Date: Tue, 31 May 2022 13:26:28 +0000 (+0200) Subject: Update db_get_accurate_jobids() to deal with one single JobId X-Git-Tag: Beta-15.0.0~566 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58c4547bb48ce90efc35ecebce6196cb8574970f;p=thirdparty%2Fbacula.git Update db_get_accurate_jobids() to deal with one single JobId --- diff --git a/bacula/src/cats/sql_get.c b/bacula/src/cats/sql_get.c index f5004cd7f..a8caf02d9 100644 --- a/bacula/src/cats/sql_get.c +++ b/bacula/src/cats/sql_get.c @@ -1680,6 +1680,17 @@ bool BDB::bdb_get_accurate_jobids(JCR *jcr, if(!bdb_sql_query(query.c_str(), db_list_handler, jobids)) { goto bail_out; } + + /* If we call the function with one jobid, we can take it + * if the result is also one jobid. It is useful when + * we deal with multiple VF or copies having the same JobTDate. + * TODO: Adjust if we have a list and we don't have the id resquested + */ + if (is_a_number(jobids->list)) { + jobids->reset(); + jobids->add(edit_uint64(from_jobid, esc)); + } + Dmsg1(1, "db_get_accurate_jobids=%s\n", jobids->list); ret = true;