[ZBX-10084] Deletion of trigger-related network map elements needs to be sorted out Created: 2015 Nov 16  Updated: 2017 May 30  Resolved: 2015 Dec 21

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 2.2.11, 2.4.7, 3.0.0alpha4
Fix Version/s: 2.2.12rc1, 2.4.8rc1, 3.0.0alpha5

Type: Incident report Priority: Trivial
Reporter: Glebs Ivanovskis (Inactive) Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

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);


 Comments   
Comment by Viktors Tjarve [ 2015 Nov 20 ]

Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-10084

Comment by Andris Zeila [ 2015 Nov 23 ]

Successfully tested

Comment by Viktors Tjarve [ 2015 Nov 23 ]

Released in:

  • 2.2.12rc1 r56848
  • 2.4.8rc1 r56850
  • pre-3.0.0alpha5 r56851
Generated at Thu Mar 28 18:46:51 EET 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.