Source
static int process_event_update(const zbx_db_trigger *trigger, char **sql, size_t *sql_alloc, size_t *sql_offset)
/*
** Zabbix
** Copyright (C) 2001-2023 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.
**/
/******************************************************************************
* *
* Purpose: gets the total number of triggers on system *
* *
* Parameters: *
* *
* Return value: The total number of triggers on system. *
* *
******************************************************************************/
static int get_trigger_count(void)
{
zbx_db_result_t result;
zbx_db_row_t row;
int triggers_num;
result = zbx_db_select("select count(*) from triggers");
if (NULL != (row = zbx_db_fetch(result)))
triggers_num = atoi(row[0]);
else
triggers_num = 0;
zbx_db_free_result(result);
return triggers_num;
}
/******************************************************************************
* *
* Purpose: checks if this is historical macro that cannot be expanded for *
* bulk event name update *
* *
* Parameters: macro - [IN] the macro name *