]> source.dussan.org Git - sonarqube.git/commitdiff
Fix CloseReviewDecorator on SQL Server and Oracle
authorsimonbrandhof <simon.brandhof@gmail.com>
Wed, 18 May 2011 14:14:18 +0000 (16:14 +0200)
committersimonbrandhof <simon.brandhof@gmail.com>
Wed, 18 May 2011 14:14:18 +0000 (16:14 +0200)
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/CloseReviewsDecorator.java

index 1ee743bacb159e4e9fc18e75c0009277ce533d7a..0b32e50b288845001d7ac87b2215b763ed860393 100644 (file)
@@ -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 ) )";
   }