aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2011-05-18 16:14:18 +0200
committersimonbrandhof <simon.brandhof@gmail.com>2011-05-18 16:14:18 +0200
commit97276ac3cd1843a539672ae25118a4f9dd807c6c (patch)
tree7fd00aed597d6c30ceddc1aaab579f9716e713e8
parent08cf32bb896fb0ec81619c5ab206fafbd187c3c7 (diff)
downloadsonarqube-97276ac3cd1843a539672ae25118a4f9dd807c6c.tar.gz
sonarqube-97276ac3cd1843a539672ae25118a4f9dd807c6c.zip
Fix CloseReviewDecorator on SQL Server and Oracle
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/CloseReviewsDecorator.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/CloseReviewsDecorator.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/CloseReviewsDecorator.java
index 1ee743bacb1..0b32e50b288 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/CloseReviewsDecorator.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/CloseReviewsDecorator.java
@@ -81,8 +81,8 @@ public class CloseReviewsDecorator implements Decorator {
}
protected String generateUpdateOnProjectSqlRequest(int projectId, int projectSnapshotId) {
- return "UPDATE reviews rv SET status='CLOSED', updated_at=CURRENT_TIMESTAMP WHERE rv.status='OPEN' AND rv.project_id=" + projectId
- + " AND rv.resource_id IN ( SELECT prev.project_id FROM snapshots prev WHERE prev.root_project_id=" + projectId
+ return "UPDATE reviews SET status='CLOSED', updated_at=CURRENT_TIMESTAMP WHERE status='OPEN' AND project_id=" + projectId
+ + " AND resource_id IN ( SELECT prev.project_id FROM snapshots prev WHERE prev.root_project_id=" + projectId
+ " AND prev.islast=? AND NOT EXISTS ( SELECT cur.id FROM snapshots cur WHERE cur.root_snapshot_id=" + projectSnapshotId
+ " AND cur.created_at > prev.created_at AND cur.root_project_id=" + projectId + " AND cur.project_id=prev.project_id ) )";
}