aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2013-05-31 13:11:25 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2013-05-31 13:11:25 +0200
commit510f15727092dfd75a1476c6054fbb3ff40e831e (patch)
treee8d3315160e9104766e5994e6c9991fa4b91c90b /sonar-core
parent2a37a23b0ff74cd69a3a4c9053f3a2331b234097 (diff)
downloadsonarqube-510f15727092dfd75a1476c6054fbb3ff40e831e.tar.gz
sonarqube-510f15727092dfd75a1476c6054fbb3ff40e831e.zip
SONAR-3755 fix JSON report when directly analyzing module (like in Eclipse plugin)
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/persistence/DryRunDatabaseFactory.java2
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'))";