Source
DBadd_condition_alloc(&sql, &sql_alloc, &sql_offset, "t.taskid", ack_taskids->values, ack_taskids->values_num);
/*
** Zabbix
** Copyright (C) 2001-2022 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
extern unsigned char process_type, program_type;
extern int server_num, process_num;
/******************************************************************************
* *
* Function: tm_execute_task_close_problem *
* *
* Purpose: close the specified problem event and remove task *
* *
* Parameters: triggerid - [IN] the source trigger id *
* eventid - [IN] the problem eventid to close *
* userid - [IN] the user that requested to close the *
* problem *
* *
******************************************************************************/
static void tm_execute_task_close_problem(zbx_uint64_t taskid, zbx_uint64_t triggerid, zbx_uint64_t eventid,
zbx_uint64_t userid)
{
DB_RESULT result;
zabbix_log(LOG_LEVEL_DEBUG, "In %s() eventid:" ZBX_FS_UI64, __func__, eventid);
result = DBselect("select null from problem where eventid=" ZBX_FS_UI64 " and r_eventid is null", eventid);
/* check if the task hasn't been already closed by another process */
if (NULL != DBfetch(result))
zbx_close_problem(triggerid, eventid, userid);