From 8b9420766f76f1a397ee31a18793e4dd126733c9 Mon Sep 17 00:00:00 2001 From: Harshan Liyanage Date: Fri, 16 Jun 2017 16:47:34 +0530 Subject: [PATCH] Fixed SQL syntax issue in DeviceStatusMonitoring Task when running on PostgreSQL. --- .../core/operation/mgt/dao/impl/OperationMappingDAOImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/OperationMappingDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/OperationMappingDAOImpl.java index 82f2cd66e75..9d9b98f7a84 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/OperationMappingDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/OperationMappingDAOImpl.java @@ -152,7 +152,8 @@ public class OperationMappingDAOImpl implements OperationMappingDAO { "DM_DEVICE D ON E.DEVICE_ID = D.ID WHERE " + "OP.STATUS IN ('"+ Operation.Status.PENDING.name() + "','" + Operation.Status.REPEATED.name() + "') " + "AND OP.CREATED_TIMESTAMP BETWEEN ? AND ? AND E.STATUS IN ('" + EnrolmentInfo.Status.ACTIVE.name() + - "','" + EnrolmentInfo.Status.UNREACHABLE.name() + "') AND D.DEVICE_TYPE_ID = ? GROUP BY ENROLMENT_ID"; + "','" + EnrolmentInfo.Status.UNREACHABLE.name() + "') AND D.DEVICE_TYPE_ID = ? GROUP BY ENROLMENT_ID," + + " D.DEVICE_IDENTIFICATION, E.STATUS, E.TENANT_ID"; stmt = conn.prepareStatement(sql); stmt.setLong(1, maxDuration); stmt.setLong(2, minDuration);