Source
zbx_db_add_condition_alloc(&sql, &sql_alloc, &sql_offset, td->table->recid, updateids.values, updateids.values_num);
/*
** 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.
**/
/*
* The configuration sync is split into 4 parts for each table:
* 1) proxyconfig_prepare_rows()
* Renames rename_field to '#'||rename_field for all rows to be updated. It's done to avoid
* possible conflicts when two field values used in unique index are swapped.
* Resets reset_field to null for all rows to be deleted or updated. It's done to avoid
* possible foreign key violation when rows in self referencing table are updated or deleted.
* The changed fields are marked as updated, so during update processing the correct values
* will be assigned to them.
*
* 2) proxyconfig_delete_rows()
* Deletes all existing rows within scope that are not present in received table data. The scope
* is limited to received hosts when partial updates are done.
*
* 3) proxyconfig_insert_rows()
* Inserts new rows that were not present in database.
*
* 4) proxyconfig_update_rows()
* Update changed fields.
*
* When processing related tables (for example drules, dchecks) the prepare and delete operations are
* done from child tables to master tables. The insert and update operations are done from master
* tables to child tables. This is done to avoid child rows being removed with cascaded deletes and
* have parent rows updated/inserted when updating/inserting child rows.
*
*/
extern int CONFIG_TRAPPER_TIMEOUT;
typedef struct
{
const ZBX_FIELD *field;
}
zbx_const_field_ptr_t;
ZBX_VECTOR_DECL(const_field, zbx_const_field_ptr_t)