]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-10505 CE processes analysis report slowly when millions of issues
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Thu, 22 Mar 2018 09:59:09 +0000 (10:59 +0100)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Thu, 22 Mar 2018 16:13:15 +0000 (17:13 +0100)
server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIteratorForSingleChunk.java

index 6a72a75c264932dbe218294e32606c8fcae9aade..57a705cfc275037599909febeed8272e5df4e497 100644 (file)
@@ -86,7 +86,7 @@ class IssueIteratorForSingleChunk implements IssueIterator {
     "inner join rules r on r.id = i.rule_id " +
     "inner join projects c on c.uuid = i.component_uuid ";
 
-  private static final String PROJECT_FILTER = " and c.project_uuid = ?";
+  private static final String PROJECT_FILTER = " and c.project_uuid = ? and i.project_uuid = ? ";
   private static final String ISSUE_KEY_FILTER_PREFIX = " and i.kee in (";
   private static final String ISSUE_KEY_FILTER_SUFFIX = ")";
 
@@ -157,6 +157,8 @@ class IssueIteratorForSingleChunk implements IssueIterator {
     if (projectUuid != null) {
       stmt.setString(index, projectUuid);
       index++;
+      stmt.setString(index, projectUuid);
+      index++;
     }
     if (issueKeys != null) {
       for (String key : issueKeys) {