src/dird/ua_restore.c
static bool insert_file_into_findex_list(UAContext *ua, RESTORE_CTX *rx, char *file,
                                        char *date)
{
   strip_trailing_newline(file);
   split_path_and_filename(ua, rx, file);
   if (*rx->JobIds == 0) {
      Mmsg(rx->query, uar_jobid_fileindex, date, rx->path, rx->fname,
           rx->ClientName);
   } else {
      Mmsg(rx->query, uar_jobids_fileindex, rx->JobIds, date,
           rx->path, rx->fname, rx->ClientName);
      /*
       * Note: we have just edited the JobIds into the query, so
       *  we need to clear JobIds, or they will be added
       *  back into JobIds with the query below, and then
       *  restored twice.  Fixes bug #2212.
       */
      rx->JobIds[0] = 0;
   }
   rx->found = false;
   /* Find and insert jobid and File Index */
   if (!db_sql_query(ua->db, rx->query, jobid_fileindex_handler, (void *)rx)) {
      ua->error_msg(_("Query failed: %s. ERR=%s\n"),
         rx->query, db_strerror(ua->db));
   }
   if (!rx->found) {
      ua->error_msg(_("No database record found for: %s\n"), file);
//    ua->error_msg("Query=%s\n", rx->query);
      return true;
   }
   return true;
}
/*
 * For a given file (path+filename), split into path and file, then
 *   lookup the most recent backup in the catalog to get the JobId
 *   and FileIndex, then insert them into the findex list.
 */
For a given file (path+filename), split into path and file, then
lookup the most recent backup in the catalog to get the JobId
and FileIndex, then insert them into the findex list.
For a given file ( path + filename ) split into path and file then lookup the most recent backup in the catalog to get the JobId and FileIndex then insert them into the findex list .
static bool insert_file_into_findex_list(UAContext *ua, RESTORE_CTX *rx, char *file,
                                        char *date)
{
   strip_trailing_newline(file);
   split_path_and_filename(ua, rx, file);
   if (*rx->JobIds == 0) {
      Mmsg(rx->query, uar_jobid_fileindex, date, rx->path, rx->fname,
           rx->ClientName);
   } else {
      Mmsg(rx->query, uar_jobids_fileindex, rx->JobIds, date,
           rx->path, rx->fname, rx->ClientName);
      rx->JobIds[0] = 0;
   }
   rx->found = false;
   if (!db_sql_query(ua->db, rx->query, jobid_fileindex_handler, (void *)rx)) {
      ua->error_msg(_("Query failed: %s. ERR=%s\n"),
         rx->query, db_strerror(ua->db));
   }
   if (!rx->found) {
      ua->error_msg(_("No database record found for: %s\n"), file);
      return true;
   }
   return true;
}
static bool insert_file_into_findex_list ( UAContext * ua , RESTORE_CTX * rx , char * file , char * date ) { strip_trailing_newline ( file ) ; split_path_and_filename ( ua , rx , file ) ; if ( * rx -> JobIds == 0 ) { Mmsg ( rx -> query , uar_jobid_fileindex , date , rx -> path , rx -> fname , rx -> ClientName ) ; } else { Mmsg ( rx -> query , uar_jobids_fileindex , rx -> JobIds , date , rx -> path , rx -> fname , rx -> ClientName ) ; rx -> JobIds [ 0 ] = 0 ; } rx -> found = false ; if ( ! db_sql_query ( ua -> db , rx -> query , jobid_fileindex_handler , ( void * ) rx ) ) { ua -> error_msg ( _ ( " \n " ) , rx -> query , db_strerror ( ua -> db ) ) ; } if ( ! rx -> found ) { ua -> error_msg ( _ ( " \n " ) , file ) ; return true ; } return true ; }
For a given file (path+filename), split into path and file, then
   lookup the most recent backup in the catalog to get the JobId
   and FileIndex, then insert them into the findex list.
For a given file ( path + filename ) split into path and file then lookup the most recent backup in the catalog to get the JobId and FileIndex then insert them into the findex list .
/*
       * Note: we have just edited the JobIds into the query, so
       *  we need to clear JobIds, or they will be added
       *  back into JobIds with the query below, and then
       *  restored twice.  Fixes bug #2212.
       */ /* Find and insert jobid and File Index */ //    ua->error_msg("Query=%s\n", rx->query);