Source
res = zbx_db_execute("update profiles set value_str='name' where idx='web.problem.sort' and value_str='problem'");
/*
** Copyright (C) 2001-2024 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
/*
* 4.0 development database patches
*/
static int DBpatch_3050000(void)
{
const zbx_db_field_t field = {"proxy_address", "", NULL, NULL, 255, ZBX_TYPE_CHAR, ZBX_NOTNULL, 0};
return DBadd_field("hosts", &field);
}
static int DBpatch_3050001(void)
{
zbx_db_result_t result;
zbx_db_row_t row;
int ret = FAIL;
/* type : 'problem' - WIDGET_PROBLEMS */
result = zbx_db_select(
"select wf.widgetid,wf.name"
" from widget w,widget_field wf"
" where w.widgetid=wf.widgetid"
" and w.type='problems'"
" and wf.name like 'tags.tag.%%'");
while (NULL != (row = zbx_db_fetch(result)))
{
const char *p;
int index;
zbx_uint64_t widget_fieldid;
if (NULL == (p = strrchr(row[1], '.')) || SUCCEED != zbx_is_uint31(p + 1, &index))
continue;
widget_fieldid = zbx_db_get_maxid_num("widget_field", 1);
/* type : 0 - ZBX_WIDGET_FIELD_TYPE_INT32 */
/* value_int : 0 - TAG_OPERATOR_LIKE */
if (ZBX_DB_OK > zbx_db_execute(
"insert into widget_field (widget_fieldid,widgetid,type,name,value_int)"
"values (" ZBX_FS_UI64 ",%s,0,'tags.operator.%d',0)", widget_fieldid, row[0], index)) {
goto clean;
}
}
ret = SUCCEED;
clean:
zbx_db_free_result(result);
return ret;
}
static int DBpatch_3050004(void)
{
const zbx_db_field_t field = {"name", "", NULL, NULL, 2048, ZBX_TYPE_CHAR, ZBX_NOTNULL, 0};
if (SUCCEED != DBadd_field("events", &field))
return FAIL;
return SUCCEED;
}
static int DBpatch_3050005(void)