summaryrefslogtreecommitdiffstats
path: root/database
diff options
context:
space:
mode:
authorCosta Tsaousis <costa@netdata.cloud>2023-07-18 21:33:48 +0300
committerGitHub <noreply@github.com>2023-07-18 21:33:48 +0300
commit5026ca027dac129e4d34da4dd8ad01b8bae7411f (patch)
tree7a3912ba68df612cd3858968a807c224adaf0713 /database
parent8f78b7cf04635e4108d5c015860cdb0d23816b06 (diff)
fix alerts transitions search when something specific is asked for (#15447)
Diffstat (limited to 'database')
-rw-r--r--database/sqlite/sqlite_health.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/database/sqlite/sqlite_health.c b/database/sqlite/sqlite_health.c
index c5651be221..3ecd783dc5 100644
--- a/database/sqlite/sqlite_health.c
+++ b/database/sqlite/sqlite_health.c
@@ -1773,11 +1773,10 @@ fail:
"d.transition_id, d.global_id, ah.class, ah.type, ah.component, d.exec_run_timestamp"
#define SQL_SEARCH_ALERT_TRANSITION_COMMON_WHERE \
- "h.config_hash_id = ah.hash_id AND h.health_log_id = d.health_log_id" \
- " AND ( d.new_status > 2 OR d.old_status > 2 )"
+ "h.config_hash_id = ah.hash_id AND h.health_log_id = d.health_log_id"
#define SQL_SEARCH_ALERT_TRANSITION SQL_SEARCH_ALERT_TRANSITION_SELECT " FROM health_log h, health_log_detail d, v_%p t, alert_hash ah " \
- " WHERE h.host_id = t.host_id AND " SQL_SEARCH_ALERT_TRANSITION_COMMON_WHERE " AND d.global_id BETWEEN @after AND @before "
+ " 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 "
#define SQL_SEARCH_ALERT_TRANSITION_DIRECT SQL_SEARCH_ALERT_TRANSITION_SELECT " FROM health_log h, health_log_detail d, alert_hash ah " \
" WHERE " SQL_SEARCH_ALERT_TRANSITION_COMMON_WHERE " AND transition_id = @transition "