diff options
author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-01-06 21:36:58 +0000 |
---|---|---|
committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-01-06 21:36:58 +0000 |
commit | 36e9c61ee2597ec52215c53622f1f13310c1a446 (patch) | |
tree | 1e70ff60d3ab384f5dcab536664ea091bc67879d | |
parent | dd9c0f550bd2b3827c740651642c3c56c6de6dd0 (diff) | |
download | zabbix-36e9c61ee2597ec52215c53622f1f13310c1a446.tar.gz zabbix-36e9c61ee2597ec52215c53622f1f13310c1a446.tar.xz zabbix-36e9c61ee2597ec52215c53622f1f13310c1a446.zip |
- remove 'insert delayed' and 'delete low_priority' for MySQL. It may lead
to triggers calculated wrong.
git-svn-id: svn://svn.zabbix.com/trunk@1588 97f52cf1-0a1b-0410-bd0e-c28be96e8082
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | include/db.c | 16 | ||||
-rw-r--r-- | src/zabbix_server/housekeeper.c | 10 |
3 files changed, 3 insertions, 24 deletions
@@ -1,6 +1,5 @@ Changes for 1.1alpha5: - - introduced 'insert delayed' and 'delete low_priority' for MySQL (Alexei) - added frontends/image.php (Alexei) - added table 'hosts_templates' (Alexei) - added table 'escalations' (Alexei) diff --git a/include/db.c b/include/db.c index 9374d91d..1ff89561 100644 --- a/include/db.c +++ b/include/db.c @@ -1689,11 +1689,7 @@ int DBadd_history_thread(MYSQL *database, int itemid, double value, int clock) zabbix_log(LOG_LEVEL_DEBUG,"In add_history()"); -#ifdef HAVE_MYSQL - snprintf(sql,sizeof(sql)-1,"insert delayed into history (clock,itemid,value) values (%d,%d,%f)",clock,itemid,value); -#else snprintf(sql,sizeof(sql)-1,"insert into history (clock,itemid,value) values (%d,%d,%f)",clock,itemid,value); -#endif DBexecute_thread(database, sql); DBadd_trend_thread(database, itemid, value, clock); @@ -1708,11 +1704,7 @@ int DBadd_history(int itemid, double value, int clock) zabbix_log(LOG_LEVEL_DEBUG,"In add_history()"); -#ifdef HAVE_MYSQL - snprintf(sql,sizeof(sql)-1,"insert delayed into history (clock,itemid,value) values (%d,%d,%f)",clock,itemid,value); -#else snprintf(sql,sizeof(sql)-1,"insert into history (clock,itemid,value) values (%d,%d,%f)",clock,itemid,value); -#endif DBexecute(sql); DBadd_trend(itemid, value, clock); @@ -1729,11 +1721,7 @@ int DBadd_history_str_thread(MYSQL *database, int itemid, char *value, int clock zabbix_log(LOG_LEVEL_DEBUG,"In add_history_str()"); DBescape_string(value,value_esc,MAX_STRING_LEN); -#ifdef HAVE_MYSQL - snprintf(sql,sizeof(sql)-1,"insert delayed into history_str (clock,itemid,value) values (%d,%d,'%s')",clock,itemid,value_esc); -#else snprintf(sql,sizeof(sql)-1,"insert into history_str (clock,itemid,value) values (%d,%d,'%s')",clock,itemid,value_esc); -#endif DBexecute_thread(database, sql); return SUCCEED; @@ -1748,11 +1736,7 @@ int DBadd_history_str(int itemid, char *value, int clock) zabbix_log(LOG_LEVEL_DEBUG,"In add_history_str()"); DBescape_string(value,value_esc,MAX_STRING_LEN); -#ifdef HAVE_MYSQL - snprintf(sql,sizeof(sql)-1,"insert delayed into history_str (clock,itemid,value) values (%d,%d,'%s')",clock,itemid,value_esc); -#else snprintf(sql,sizeof(sql)-1,"insert into history_str (clock,itemid,value) values (%d,%d,'%s')",clock,itemid,value_esc); -#endif DBexecute(sql); return SUCCEED; diff --git a/src/zabbix_server/housekeeper.c b/src/zabbix_server/housekeeper.c index 37b81c4e..2550752a 100644 --- a/src/zabbix_server/housekeeper.c +++ b/src/zabbix_server/housekeeper.c @@ -146,7 +146,7 @@ int housekeeping_history_and_trends(int now) /* Delete HISTORY */ #ifdef HAVE_MYSQL - snprintf(sql,sizeof(sql)-1,"delete low_priority from history where itemid=%d and clock<%d limit %d",item.itemid,now-24*3600*item.history,2*CONFIG_HOUSEKEEPING_FREQUENCY*3600/item.delay); + snprintf(sql,sizeof(sql)-1,"delete from history where itemid=%d and clock<%d limit %d",item.itemid,now-24*3600*item.history,2*CONFIG_HOUSEKEEPING_FREQUENCY*3600/item.delay); #else snprintf(sql,sizeof(sql)-1,"delete from history where itemid=%d and clock<%d",item.itemid,now-24*3600*item.history); #endif @@ -158,7 +158,7 @@ int housekeeping_history_and_trends(int now) /* Delete HISTORY_STR */ #ifdef HAVE_MYSQL - snprintf(sql,sizeof(sql)-1,"delete low_priority from history_str where itemid=%d and clock<%d limit %d",item.itemid,now-24*3600*item.history,2*CONFIG_HOUSEKEEPING_FREQUENCY*3600/item.delay); + snprintf(sql,sizeof(sql)-1,"delete from history_str where itemid=%d and clock<%d limit %d",item.itemid,now-24*3600*item.history,2*CONFIG_HOUSEKEEPING_FREQUENCY*3600/item.delay); #else snprintf(sql,sizeof(sql)-1,"delete from history_str where itemid=%d and clock<%d",item.itemid,now-24*3600*item.history); #endif @@ -170,7 +170,7 @@ int housekeeping_history_and_trends(int now) /* Delete HISTORY_TRENDS */ #ifdef HAVE_MYSQL - snprintf(sql,sizeof(sql)-1,"delete low_priority from trends where itemid=%d and clock<%d limit %d",item.itemid,now-24*3600*item.trends,2*CONFIG_HOUSEKEEPING_FREQUENCY*3600/item.delay); + snprintf(sql,sizeof(sql)-1,"delete from trends where itemid=%d and clock<%d limit %d",item.itemid,now-24*3600*item.trends,2*CONFIG_HOUSEKEEPING_FREQUENCY*3600/item.delay); #else snprintf(sql,sizeof(sql)-1,"delete from trends where itemid=%d and clock<%d",item.itemid,now-24*3600*item.trends); #endif @@ -199,11 +199,7 @@ int housekeeping_sessions(int now) { char sql[MAX_STRING_LEN]; -#ifdef HAVE_MYSQL - snprintf(sql,sizeof(sql)-1,"delete low_priority from sessions where lastaccess<%d",now-24*3600); -#else snprintf(sql,sizeof(sql)-1,"delete from sessions where lastaccess<%d",now-24*3600); -#endif #ifdef ZABBIX_THREADS DBexecute_thread(database,sql); #else |