From 41187a33150d78f05b028f090941590de398af18 Mon Sep 17 00:00:00 2001 From: Eriks Jenkevics Date: Tue, 17 Oct 2017 16:17:57 +0300 Subject: [PATCH] Fixed bug in saving common agent policy properties to DB --- src/server/core/agent_policy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/core/agent_policy.cpp b/src/server/core/agent_policy.cpp index 9745acb47..e4e749f73 100644 --- a/src/server/core/agent_policy.cpp +++ b/src/server/core/agent_policy.cpp @@ -66,7 +66,7 @@ bool AgentPolicy::savePolicyCommonProperties(DB_HANDLE hdb) return false; DB_STATEMENT hStmt; - if (IsDatabaseRecordExist(hdb, _T("ap_common"), _T("id"), m_id)) + if (!IsDatabaseRecordExist(hdb, _T("ap_common"), _T("id"), m_id)) hStmt = DBPrepare(hdb, _T("INSERT INTO ap_common (policy_type,version,id) VALUES (?,?,?)")); else hStmt = DBPrepare(hdb, _T("UPDATE ap_common SET policy_type=?,version=? WHERE id=?")); -- 2.20.1