void zbx_db_insert_prepare_dyn(zbx_db_insert_t *self, const ZBX_TABLE *table, const ZBX_FIELD **fields, int fields_num)
#include "zbx_host_constants.h"
#include "zbx_trigger_constants.h"
#include "zbx_dbversion_constants.h"
#define ZBX_DB_WAIT_DOWN 10
#define ZBX_MAX_SQL_SIZE 262144
#ifndef ZBX_MAX_OVERFLOW_SQL_SIZE
# define ZBX_MAX_OVERFLOW_SQL_SIZE 0
# define ZBX_MAX_OVERFLOW_SQL_SIZE ZBX_MAX_SQL_SIZE
#elif 0 != ZBX_MAX_OVERFLOW_SQL_SIZE && \
(1024 > ZBX_MAX_OVERFLOW_SQL_SIZE || ZBX_MAX_OVERFLOW_SQL_SIZE > ZBX_MAX_SQL_SIZE)
#error ZBX_MAX_OVERFLOW_SQL_SIZE is out of range
# if 0 == ZBX_MAX_OVERFLOW_SQL_SIZE
# define ZBX_SQL_EXEC_FROM ZBX_CONST_STRLEN(ZBX_PLSQL_BEGIN)
# define ZBX_SQL_EXEC_FROM 0
# define ZBX_SQL_EXEC_FROM 0
#ifdef HAVE_MULTIROW_INSERT
# define ZBX_ROW_DL ";\n"
#if defined(HAVE_POSTGRESQL)
extern char ZBX_PG_ESCAPE_BACKSLASH;
static int connection_failure;
static const zbx_config_dbhigh_t *zbx_cfg_dbhigh = NULL;
static zbx_dc_get_nextid_func_t zbx_cb_nextid;
int zbx_db_validate_config_features(unsigned char program_type, const zbx_config_dbhigh_t *config_dbhigh)
#if !(defined(HAVE_MYSQL_TLS) || defined(HAVE_MARIADB_TLS) || defined(HAVE_POSTGRESQL))
err |= (FAIL == check_cfg_feature_str("DBTLSConnect", config_dbhigh->config_db_tls_connect,
"PostgreSQL or MySQL library version that support TLS"));
err |= (FAIL == check_cfg_feature_str("DBTLSCAFile", config_dbhigh->config_db_tls_ca_file,
"PostgreSQL or MySQL library version that support TLS"));
err |= (FAIL == check_cfg_feature_str("DBTLSCertFile", config_dbhigh->config_db_tls_cert_file,
"PostgreSQL or MySQL library version that support TLS"));
err |= (FAIL == check_cfg_feature_str("DBTLSKeyFile", config_dbhigh->config_db_tls_key_file,