From 359466a1b62b8f49b19cd282b6d58bc053e34714 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelsalam Date: Tue, 28 Jan 2025 09:30:20 +0100 Subject: [PATCH] Fix: Fix misalignment of delta results comparison --- src/manage_sql.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/manage_sql.c b/src/manage_sql.c index 7d26fa904..7c44ed21e 100644 --- a/src/manage_sql.c +++ b/src/manage_sql.c @@ -28940,7 +28940,7 @@ init_delta_iterator (report_t report, iterator_t *results, report_t delta, " AND (r1a.new_severity = 0) = (r2a.new_severity = 0)" " AND (r1a.description = r2a.description)" " WINDOW w1 AS (PARTITION BY r1a.host, normalize_port(r1a.port)," - " r1a.nvt, r1a.new_severity = 0, r2a.id is null ORDER BY r2a.id)" + " r1a.nvt, r1a.new_severity = 0, r2a.id is null ORDER BY r1a.description, r2a.id)" " ORDER BY r1a.id)," " r2 as (SELECT DISTINCT ON (r2a.id) r2a.*, r1a.id as r1id, row_number() over w2 as r2_rank" " FROM r2a LEFT JOIN r1a ON r2a.host = r1a.host" @@ -28949,7 +28949,7 @@ init_delta_iterator (report_t report, iterator_t *results, report_t delta, " AND (r2a.new_severity = 0) = (r1a.new_severity = 0)" " AND (r2a.description = r1a.description)" " WINDOW w2 AS (PARTITION BY r2a.host, normalize_port(r2a.port)," - " r2a.nvt, r2a.new_severity = 0, r1a.id is null ORDER BY r1a.id)" + " r2a.nvt, r2a.new_severity = 0, r1a.id is null ORDER BY r2a.description, r1a.id)" " ORDER BY r2a.id)" " (SELECT r1.id AS result1_id," " r2.id AS result2_id,"