From b5edc88502a9833e32be4c3e3c9fd18e2327cce8 Mon Sep 17 00:00:00 2001 From: hugetoad Date: Fri, 2 Jun 2006 07:33:25 +0000 Subject: Fixed crash under Oracle. git-svn-id: svn://svn.zabbix.com/trunk@2943 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- src/zabbix_server/functions.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/zabbix_server/functions.c b/src/zabbix_server/functions.c index 109d3384..dfdcc508 100644 --- a/src/zabbix_server/functions.c +++ b/src/zabbix_server/functions.c @@ -698,7 +698,11 @@ static int update_item(DB_ITEM *item, AGENT_RESULT *value, int now) if(item->delta == ITEM_STORE_AS_IS) { - if((item->prevvalue_null == 1) || (strcmp(value_str,item->lastvalue_str) != 0) || (strcmp(item->prevvalue_str,item->lastvalue_str) != 0) ) +/* if((item->prevvalue_null == 1) || (strcmp(value_str,item->lastvalue_str) != 0) || (strcmp(item->prevvalue_str,item->lastvalue_str) != 0) )*/ +/* Fixed crash when lastvalue == NULL */ + if((item->prevvalue_null == 1) || (item->lastvalue_null == 1) || + (strcmp(value_str,item->lastvalue_str) != 0) || + (strcmp(item->prevvalue_str,item->lastvalue_str) != 0)) { DBescape_string(value_str,value_esc,MAX_STRING_LEN); /* snprintf(sql,sizeof(sql)-1,"update items set nextcheck=%d,prevvalue=lastvalue,lastvalue='%s',lastclock=%d where itemid=%d",now+item->delay,value_esc,now,item->itemid);*/ -- cgit