]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Update db_get_accurate_jobids() to deal with one single JobId
authorEric Bollengier <eric@baculasystems.com>
Tue, 31 May 2022 13:26:28 +0000 (15:26 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:56:58 +0000 (13:56 +0200)
bacula/src/cats/sql_get.c

index f5004cd7f19653d8a3f47457882dbca8775c1583..a8caf02d9fbf7613db9f937df7132a08e4b1f690 100644 (file)
@@ -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;