Source
if (ZBX_DB_OK > zbx_db_execute("update profiles set idx=CONCAT('web.dashboard.widget.navtree.item-', SUBSTR(idx, 21))"
/*
** 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/>.
**/
/*
* 5.4 development database patches
*/
static int DBpatch_5030000(void)
{
if (0 == (DBget_program_type() & ZBX_PROGRAM_TYPE_SERVER))
return SUCCEED;
if (ZBX_DB_OK > zbx_db_execute("delete from profiles where idx='web.queue.config'"))
return FAIL;
return SUCCEED;
}
typedef struct
{
zbx_uint64_t id;
zbx_uint64_t userid;
char *idx;
zbx_uint64_t idx2;
zbx_uint64_t value_id;
int value_int;
char *value_str;
char *source;
int type;
}
zbx_dbpatch_profile_t;
static void DBpatch_get_key_fields(zbx_db_row_t row, zbx_dbpatch_profile_t *profile, char **subsect, char **field,
char **key)
{
int tok_idx = 0;
char *token;
ZBX_DBROW2UINT64(profile->id, row[0]);
ZBX_DBROW2UINT64(profile->userid, row[1]);
profile->idx = zbx_strdup(profile->idx, row[2]);
ZBX_DBROW2UINT64(profile->idx2, row[3]);
ZBX_DBROW2UINT64(profile->value_id, row[4]);
profile->value_int = atoi(row[5]);
profile->value_str = zbx_strdup(profile->value_str, row[6]);
profile->source = zbx_strdup(profile->source, row[7]);
profile->type = atoi(row[8]);
token = strtok(profile->idx, ".");
while (NULL != token)
{
token = strtok(NULL, ".");
tok_idx++;
if (1 == tok_idx)
{