Sat, 23 Jan 2021 14:47:59 +0100
fixes issue query returning issues more than once
src/main/kotlin/de/uapcore/lightpit/dao/PostgresDataAccessObject.kt | file | annotate | diff | comparison | revisions |
1.1 --- a/src/main/kotlin/de/uapcore/lightpit/dao/PostgresDataAccessObject.kt Wed Jan 06 16:41:09 2021 +0100 1.2 +++ b/src/main/kotlin/de/uapcore/lightpit/dao/PostgresDataAccessObject.kt Sat Jan 23 14:47:59 2021 +0100 1.3 @@ -547,11 +547,16 @@ 1.4 with issue_version as ( 1.5 select issueid, versionid from lpit_issue_affected_version 1.6 union select issueid, versionid from lpit_issue_resolved_version 1.7 - ) ${issueQuery} left join issue_version using (issueid) 1.8 - where 1.9 - (not ? or projectid = ?) and 1.10 - (not ? or versionid = ?) and (not ? or versionid is null) and 1.11 - (not ? or component = ?) and (not ? or component is null) 1.12 + ), 1.13 + filteterd_issues as ( 1.14 + select distinct issueid from lpit_issue 1.15 + left join issue_version using (issueid) 1.16 + where 1.17 + (not ? or project = ?) and 1.18 + (not ? or versionid = ?) and (not ? or versionid is null) and 1.19 + (not ? or component = ?) and (not ? or component is null) 1.20 + ) 1.21 + ${issueQuery} join filteterd_issues using (issueid) 1.22 """ 1.23 ) 1.24 }