delete raw_dci_values record on DCI delete
authorVictor Kirhenshtein <victor@netxms.org>
Mon, 23 Oct 2017 20:59:04 +0000 (23:59 +0300)
committerVictor Kirhenshtein <victor@netxms.org>
Mon, 23 Oct 2017 20:59:04 +0000 (23:59 +0300)
src/server/core/dcitem.cpp

index aee2f3e..838fa2f 100644 (file)
@@ -540,6 +540,8 @@ void DCItem::deleteFromDatabase()
    QueueSQLRequest(szQuery);
    _sntprintf(szQuery, sizeof(szQuery) / sizeof(TCHAR), _T("DELETE FROM thresholds WHERE item_id=%d"), m_id);
    QueueSQLRequest(szQuery);
+   _sntprintf(szQuery, sizeof(szQuery) / sizeof(TCHAR), _T("DELETE FROM raw_dci_values WHERE item_id=%d"), m_id);
+   QueueSQLRequest(szQuery);
 
    if (m_owner->isDataCollectionTarget())
       static_cast<DataCollectionTarget*>(m_owner)->scheduleItemDataCleanup(m_id);