Ad Widget

Collapse

Bug in evalfunc.c ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Vince2
    Member
    • Oct 2006
    • 40

    #1

    Bug in evalfunc.c ?

    Hi !

    In evalfunc.c, there is something like this :

    Code:
    		result = DBselectN(sql, parameter);
    		row = DBfetch(result);
    		if(!row || DBis_null(row[0])==SUCCEED)
    		{
    			zabbix_log(LOG_LEVEL_DEBUG, "Result for SUM is empty" );
    			res = FAIL;
    		}
    		else
    		{
    			if(item->value_type == ITEM_VALUE_TYPE_UINT64)
    			{
    				while((row=DBfetch(result)))
    OK, second line, there is a DBfetch. Last line, the loop with DBfetch. Therefore, we drop the first row. The bug also appears for AVG. I didn't check for other functions. This is not an important bug since the result is still a correct sum, but we drop the most recent value.
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    Fixed. Thanks for reporting this.
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    Working...