Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/monk/agent/database.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ PGresult* queryFileIdsForUploadAndLimits(fo_dbManager* dbManager, int uploadId,
"SELECT distinct ON(ut.uploadtree_pk, ut.pfile_fk, scopesort) ut.pfile_fk pfile_fk, ut.uploadtree_pk, decision_type,"
" CASE cd.scope WHEN 1 THEN 1 ELSE 0 END AS scopesort"
" FROM %s AS ut "
" LEFT JOIN clearing_decision cd ON "
" ((ut.uploadtree_pk = cd.uploadtree_fk AND scope = 0 AND cd.group_fk = $5) "
" OR (ut.pfile_fk = cd.pfile_fk AND scope = 1)) "
" LEFT JOIN clearing_decision cd ON ("
" (ut.uploadtree_pk = cd.uploadtree_fk AND cd.scope = 0 AND cd.group_fk = $5)"
" OR (EXISTS ("
" SELECT 1 FROM report_info ri WHERE ri.upload_fk = ut.upload_fk AND ri.ri_globaldecision = 1"
" ) AND ut.pfile_fk = cd.pfile_fk AND cd.scope = 1)"
")"
" WHERE upload_fk=$1 AND (ufile_mode&x'3C000000'::int)=0 AND (lft BETWEEN $2 AND $3) AND ut.pfile_fk != 0"
" ORDER BY ut.uploadtree_pk, scopesort, ut.pfile_fk, clearing_decision_pk DESC"
") itemView WHERE decision_type!=$4 OR decision_type IS NULL";
Expand Down
Loading