Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-10084

Deletion of trigger-related network map elements needs to be sorted out

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Fixed
    • Icon: Trivial Trivial
    • 2.2.12rc1, 2.4.8rc1, 3.0.0alpha5
    • 2.2.11, 2.4.7, 3.0.0alpha4
    • Server (S)
    • None

      Seems like in src/libs/zbxdbhigh/host.c in function DBdelete_triggers() piece of code

      	DBget_sysmapelements_by_element_type_ids(&selementids, SYSMAP_ELEMENT_TYPE_TRIGGER, triggerids);
      	if (0 != selementids.values_num)
      	{
      		zbx_strcpy_alloc(&sql, &sql_alloc, &sql_offset, "delete from sysmaps_elements where");
      		DBadd_condition_alloc(&sql, &sql_alloc, &sql_offset, "selementid", selementids.values,
      				selementids.values_num);
      		zbx_strcpy_alloc(&sql, &sql_alloc, &sql_offset, ";\n");
      	}
      

      has no affect on execution since it's followed by

      	sql_offset = 0;
      

      and composing another SQL statement.

      Lines

      	sql_offset = 0;
      	DBbegin_multiple_update(&sql, &sql_alloc, &sql_offset);
      

      should probably be moved on top of

      	DBget_sysmapelements_by_element_type_ids(&selementids, SYSMAP_ELEMENT_TYPE_TRIGGER, triggerids);
      

            Unassigned Unassigned
            glebs.ivanovskis Glebs Ivanovskis (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: