static int DBpatch_4050001(void)
return DBdrop_foreign_key("items", 1);
static int DBpatch_4050002(void)
return DBdrop_index("items", "items_1");
static int DBpatch_4050003(void)
const zbx_db_field_t field = {"key_", "", NULL, NULL, 2048, ZBX_TYPE_CHAR, ZBX_NOTNULL, 0};
return DBmodify_field_type("items", &field, NULL);
static int DBpatch_4050004(void)
return DBcreate_index("items", "items_1", "hostid,key_(1021)", 0);
return DBcreate_index("items", "items_1", "hostid,key_", 0);
static int DBpatch_4050005(void)
const zbx_db_field_t field = {"hostid", NULL, "hosts", "hostid", 0, 0, 0, ZBX_FK_CASCADE_DELETE};
return DBadd_foreign_key("items", 1, &field);
static int DBpatch_4050006(void)
const zbx_db_field_t field = {"key_", "", NULL, NULL, 2048, ZBX_TYPE_CHAR, ZBX_NOTNULL, 0};
return DBmodify_field_type("item_discovery", &field, NULL);
static int DBpatch_4050007(void)
const zbx_db_field_t field = {"key_", "", NULL, NULL, 2048, ZBX_TYPE_CHAR, ZBX_NOTNULL, 0};
return DBmodify_field_type("dchecks", &field, NULL);
static int DBpatch_4050011(void)
#if defined(HAVE_IBM_DB2) || defined(HAVE_POSTGRESQL)
const char *cast_value_str = "bigint";
#elif defined(HAVE_MYSQL)
const char *cast_value_str = "unsigned";
if (ZBX_DB_OK > zbx_db_execute(
" set value_id=CAST(value_str as %s),"
" and (idx='web.latest.filter.groupids' or idx='web.latest.filter.hostids')", cast_value_str))