From 38e858e38d75d4c4925ed1403a703e59e4e119a8 Mon Sep 17 00:00:00 2001 From: prachi Date: Tue, 23 Aug 2011 11:53:24 -0700 Subject: [PATCH] Bug 11213 - UserConcentratedPod returning wrong list of pods Changes: - Needed to add parentheses to the query to get correct results. --- server/src/com/cloud/vm/dao/UserVmDaoImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/com/cloud/vm/dao/UserVmDaoImpl.java b/server/src/com/cloud/vm/dao/UserVmDaoImpl.java index 193bf577c28..b3c6c607e95 100755 --- a/server/src/com/cloud/vm/dao/UserVmDaoImpl.java +++ b/server/src/com/cloud/vm/dao/UserVmDaoImpl.java @@ -73,7 +73,7 @@ public class UserVmDaoImpl extends GenericDaoBase implements Use protected SearchBuilder UserVmSearch; protected final Attribute _updateTimeAttr; - private static final String LIST_PODS_HAVING_VMS_FOR_ACCOUNT = "SELECT pod_id FROM cloud.vm_instance WHERE data_center_id = ? AND account_id = ? AND pod_id IS NOT NULL AND state = 'Running' OR state = 'Stopped' " + + private static final String LIST_PODS_HAVING_VMS_FOR_ACCOUNT = "SELECT pod_id FROM cloud.vm_instance WHERE data_center_id = ? AND account_id = ? AND pod_id IS NOT NULL AND (state = 'Running' OR state = 'Stopped') " + "GROUP BY pod_id HAVING count(id) > 0 ORDER BY count(id) DESC"; private static final String VM_DETAILS = "select account.account_name, account.type, domain.name, instance_group.id, instance_group.name," +