From 97276ac3cd1843a539672ae25118a4f9dd807c6c Mon Sep 17 00:00:00 2001 From: simonbrandhof Date: Wed, 18 May 2011 16:14:18 +0200 Subject: [PATCH] Fix CloseReviewDecorator on SQL Server and Oracle --- .../org/sonar/plugins/core/sensors/CloseReviewsDecorator.java | 4 ++-- 1 file 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 ) )"; } -- 2.39.5