summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-08-12 14:36:28 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-08-12 14:36:28 +0000
commit43e14ba71f408eb30acd4c46a22e7f7ecb65c997 (patch)
treeedba7b8708f53de25f0b2b22f2c7fe0a56545e50 /src
parent9b414f6bc817fb041b960df504933d4694e4bd61 (diff)
downloadzabbix-43e14ba71f408eb30acd4c46a22e7f7ecb65c997.tar.gz
zabbix-43e14ba71f408eb30acd4c46a22e7f7ecb65c997.tar.xz
zabbix-43e14ba71f408eb30acd4c46a22e7f7ecb65c997.zip
- [DEV-201] improved performance on disabling/enabling, deleting hosts (Artem)
- [DEV-137] selections *all and groups *all are not saved to profiles (Artem) - [DEV-199] some fixes (Artem) git-svn-id: svn://svn.zabbix.com/trunk@5899 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src')
-rw-r--r--src/libs/zbxdbhigh/db.c3
-rw-r--r--src/libs/zbxdbhigh/host.c3
2 files changed, 3 insertions, 3 deletions
diff --git a/src/libs/zbxdbhigh/db.c b/src/libs/zbxdbhigh/db.c
index a887d252..94720010 100644
--- a/src/libs/zbxdbhigh/db.c
+++ b/src/libs/zbxdbhigh/db.c
@@ -740,7 +740,8 @@ void DBdelete_trigger(zbx_uint64_t triggerid)
triggerid);
DBexecute("delete from functions where triggerid=" ZBX_FS_UI64,
triggerid);
- DBexecute("delete from events where triggerid=" ZBX_FS_UI64,
+ DBexecute("delete from events where object=%d AND objectid=" ZBX_FS_UI64,
+ EVENT_OBJECT_TRIGGER,
triggerid);
/* zbx_snprintf(sql,sizeof(sql),"delete from actions where triggerid=%d and scope=%d", triggerid, ACTION_SCOPE_TRIGGER);
DBexecute(sql);*/
diff --git a/src/libs/zbxdbhigh/host.c b/src/libs/zbxdbhigh/host.c
index 81159296..fe2f88bd 100644
--- a/src/libs/zbxdbhigh/host.c
+++ b/src/libs/zbxdbhigh/host.c
@@ -3053,8 +3053,7 @@ static int DBadd_event(
if( !now ) now = time(NULL);
- db_events = DBselect("select value,clock from events where objectid=" ZBX_FS_UI64 " and object=%i "
- " order by clock desc", triggerid, EVENT_OBJECT_TRIGGER);
+ db_events = DBselect("select lastvalue,type from triggers where triggerid=" ZBX_FS_UI64, triggerid);
if( (event_data = DBfetch(db_events)) )
{