fix alerts transitions search when something specific is asked for (#15447)
Costa Tsaousis committed
Jul 18, 2023 at 21:33 UTC
5026ca027dac129e4d34da4dd8ad01b8bae7411f
1 file changed
+2
-3
database/sqlite/sqlite_health.c
+2
-3
@@ -1773,11 +1773,10 @@ fail:
1773
"d.transition_id, d.global_id, ah.class, ah.type, ah.component, d.exec_run_timestamp"
1774
1775
#define SQL_SEARCH_ALERT_TRANSITION_COMMON_WHERE \
1776
- "h.config_hash_id = ah.hash_id AND h.health_log_id = d.health_log_id" \
1777
- " AND ( d.new_status > 2 OR d.old_status > 2 )"
1776
+ "h.config_hash_id = ah.hash_id AND h.health_log_id = d.health_log_id"
1777
1778
#define SQL_SEARCH_ALERT_TRANSITION SQL_SEARCH_ALERT_TRANSITION_SELECT " FROM health_log h, health_log_detail d, v_%p t, alert_hash ah " \
1780
- " WHERE h.host_id = t.host_id AND " SQL_SEARCH_ALERT_TRANSITION_COMMON_WHERE " AND d.global_id BETWEEN @after AND @before "
1779
+ " WHERE h.host_id = t.host_id AND " SQL_SEARCH_ALERT_TRANSITION_COMMON_WHERE " AND ( d.new_status > 2 OR d.old_status > 2 ) AND d.global_id BETWEEN @after AND @before "
1780
1781
#define SQL_SEARCH_ALERT_TRANSITION_DIRECT SQL_SEARCH_ALERT_TRANSITION_SELECT " FROM health_log h, health_log_detail d, alert_hash ah " \
1782
" WHERE " SQL_SEARCH_ALERT_TRANSITION_COMMON_WHERE " AND transition_id = @transition "