Skip to content

Commit

Permalink
fixup query
Browse files Browse the repository at this point in the history
  • Loading branch information
pstorz committed Apr 13, 2017
1 parent b65c022 commit 72b0d5e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
10 changes: 6 additions & 4 deletions src/cats/dml/0036_select_recent_version.postgresql
@@ -1,3 +1,4 @@

SELECT DISTINCT ON (File.Name,
PathId) JobTDate,
JobId,
Expand All @@ -7,8 +8,9 @@ SELECT DISTINCT ON (File.Name,
File.Name,
LStat,
MD5
FROM File
FROM FILE
JOIN Job USING (JobId)
WHERE JobId IN (%s) BY File.Name,
PathId,
JobTDate DESC
WHERE JobId IN (%s)
ORDER BY File.Name,
PathId,
JobTDate DESC
12 changes: 9 additions & 3 deletions src/dird/backup.c
Expand Up @@ -355,9 +355,15 @@ bool send_accurate_current_files(JCR *jcr)

if (jcr->HasBase) {
jcr->nb_base_files = str_to_int64(nb.list);
jcr->db->create_base_file_list(jcr, jobids.list);
jcr->db->get_base_file_list(jcr, jcr->use_accurate_chksum,
accurate_list_handler, (void *)jcr);
if (!jcr->db->create_base_file_list(jcr, jobids.list)){
Jmsg0(jcr, M_FATAL, 0, "error in jcr->db->create_base_file_list\n");
return false;
}
if (!jcr->db->get_base_file_list(jcr, jcr->use_accurate_chksum,
accurate_list_handler, (void *)jcr)) {
Jmsg0(jcr, M_FATAL, 0, "error in jcr->db->get_base_file_list\n");
return false;
}
} else {
if (!jcr->db->open_batch_connection(jcr)) {
Jmsg0(jcr, M_FATAL, 0, "Can't get batch sql connection");
Expand Down

0 comments on commit 72b0d5e

Please sign in to comment.