diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2013-05-31 13:11:25 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2013-05-31 13:11:25 +0200 |
commit | 510f15727092dfd75a1476c6054fbb3ff40e831e (patch) | |
tree | e8d3315160e9104766e5994e6c9991fa4b91c90b /sonar-core/src/main | |
parent | 2a37a23b0ff74cd69a3a4c9053f3a2331b234097 (diff) | |
download | sonarqube-510f15727092dfd75a1476c6054fbb3ff40e831e.tar.gz sonarqube-510f15727092dfd75a1476c6054fbb3ff40e831e.zip |
SONAR-3755 fix JSON report when directly analyzing module (like in Eclipse plugin)
Diffstat (limited to 'sonar-core/src/main')
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/persistence/DryRunDatabaseFactory.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/DryRunDatabaseFactory.java b/sonar-core/src/main/java/org/sonar/core/persistence/DryRunDatabaseFactory.java index 0ecfc403f79..dcf0231c742 100644 --- a/sonar-core/src/main/java/org/sonar/core/persistence/DryRunDatabaseFactory.java +++ b/sonar-core/src/main/java/org/sonar/core/persistence/DryRunDatabaseFactory.java @@ -77,7 +77,7 @@ public class DryRunDatabaseFactory implements ServerComponent { .copyTable(source, dest, "rules_profiles"); if (projectId != null) { String snapshotCondition = "islast=" + database.getDialect().getTrueSqlValue() + " and (project_id=" + projectId + " or root_project_id=" + projectId + ")"; - template.copyTable(source, dest, "projects", "(id=" + projectId + " or root_id=" + projectId + ")"); + template.copyTable(source, dest, "projects", "id in (select project_id from snapshots where " + snapshotCondition + ") or (id=" + projectId + " or root_id=" + projectId + ")"); template.copyTable(source, dest, "snapshots", snapshotCondition); String forRootModule = "(root_component_id in (select id from projects where id=" + projectId + " and qualifier='TRK'))"; |