#include "zbx_availability_constants.h"
#include "zbx_host_constants.h"
static int DBpatch_6010000(void)
if (0 == (DBget_program_type() & ZBX_PROGRAM_TYPE_SERVER))
if (ZBX_DB_OK > zbx_db_execute("update users set passwd='' where length(passwd)=%d", ZBX_MD5_SIZE))
static int DBpatch_6010001(void)
const zbx_db_field_t field = {"vault_provider", "0", NULL, NULL, 0, ZBX_TYPE_INT, ZBX_NOTNULL, 0};
return DBadd_field("config", &field);
static int DBpatch_6010002(void)
char *sql = NULL, *descripton_esc;
size_t sql_alloc = 0, sql_offset = 0;
"select triggerid,description"
" where " ZBX_DB_CHAR_LENGTH(description) ">%d", 255);
zbx_db_begin_multiple_update(&sql, &sql_alloc, &sql_offset);
while (NULL != (row = zbx_db_fetch(result)))
row[1][zbx_strlen_utf8_nchars(row[1], 255)] = '\0';
descripton_esc = zbx_db_dyn_escape_field("triggers", "description", row[1]);
zbx_snprintf_alloc(&sql, &sql_alloc, &sql_offset,
"update triggers set description='%s' where triggerid=%s;\n", descripton_esc, row[0]);
zbx_free(descripton_esc);
if (SUCCEED != (ret = zbx_db_execute_overflowed_sql(&sql, &sql_alloc, &sql_offset)))
zbx_db_end_multiple_update(&sql, &sql_alloc, &sql_offset);
if (16 < sql_offset && ZBX_DB_OK > zbx_db_execute("%s", sql))
zbx_db_free_result(result);
static int DBpatch_6010003(void)
const zbx_db_field_t old_field = {"description", "", NULL, NULL, 0, ZBX_TYPE_SHORTTEXT, ZBX_NOTNULL, 0};
const zbx_db_field_t field = {"description", "", NULL, NULL, 255, ZBX_TYPE_CHAR, ZBX_NOTNULL, 0};