Hi,
I created a test trigger that changes it's value every 3 or 4 minutes. It worked fine for a time, switching between TRUE and FALSE, along with "events" who also showed alternated TRUE and FALSE values.
All of a sudden, after a few hours, the "events" table and web page stopped recording FALSE events, only TRUE events are recorded.
After debugging, it appears that the problem lies in "src/libs/zbxdbhigh/db.c:et_latest_event_status()", around line:
When it is executed, like for example here:
the sql query fetches the FIRST 20 values instead of the LAST 20 values. Therefore, because I have lots of events for this trigger, as soon as I have more than 20 events, this query does not work correctly anymore and always return bogus data...
This is a serious bug because event logging will quickly stop working correctly.
This bug was introduced by rev 4156, which suppressed "DESC" in the SQL query. But because "event_prev_status" is not used anymore in db.c (the line using it are commented), it is safe to add "DESC" again to get the code to work again.
But, as LIMIT is used in many places in the code, I wanted to know if there are other places where the SQL query won't work correctly because of the "LIMIT" bug?
Regards
I created a test trigger that changes it's value every 3 or 4 minutes. It worked fine for a time, switching between TRUE and FALSE, along with "events" who also showed alternated TRUE and FALSE values.
All of a sudden, after a few hours, the "events" table and web page stopped recording FALSE events, only TRUE events are recorded.
After debugging, it appears that the problem lies in "src/libs/zbxdbhigh/db.c:et_latest_event_status()", around line:
Code:
result = DBselectN(sql,20);
Code:
3779:20070523:175531 Query [select eventid,value,clock from events where source=0 and object=0 and objectid=12456 order by clock limit 20]
This is a serious bug because event logging will quickly stop working correctly.
This bug was introduced by rev 4156, which suppressed "DESC" in the SQL query. But because "event_prev_status" is not used anymore in db.c (the line using it are commented), it is safe to add "DESC" again to get the code to work again.
But, as LIMIT is used in many places in the code, I wanted to know if there are other places where the SQL query won't work correctly because of the "LIMIT" bug?
Regards
Comment