Fix health query (#15589)
Fix query
Stelios Fragkakis committed
Jul 28, 2023 at 00:03 UTC
4db4ea4e1bef0c74650835d01487c2b61cc38248
1 file changed
+4
-1
database/sqlite/sqlite_health.c
+4
-1
@@ -692,7 +692,10 @@ failed:
692
error_report("HEALTH [N/A]: Failed to finalize the prepared statement for injecting removed event.");
693
}
694
695
-#define SQL_SELECT_MAX_UNIQUE_ID "SELECT MAX(hld.unique_id) from health_log_detail hld, health_log hl where hl.host_id = @host_id; and hl.health_log_id = hld.health_log_id"
695
+#define SQL_SELECT_MAX_UNIQUE_ID \
696
+ "SELECT MAX(hld.unique_id) FROM health_log_detail hld, health_log hl " \
697
+ "WHERE hl.host_id = @host_id AND hl.health_log_id = hld.health_log_id"
698
+
699
uint32_t sql_get_max_unique_id (RRDHOST *host)
700
{
701
int rc;