From 816fa958f9cffb494f5a2b42c71d498a36c22f89 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelsalam Date: Mon, 13 Jan 2025 09:48:39 +0100 Subject: [PATCH] Dropping the brackets --- src/manage_pg.c | 8 ++++---- src/manage_sql.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/manage_pg.c b/src/manage_pg.c index a6aedacf4..500bf093b 100644 --- a/src/manage_pg.c +++ b/src/manage_pg.c @@ -938,15 +938,15 @@ manage_create_sql_functions () " CASE" " WHEN (SELECT count(*) FROM results" " WHERE report = report_id" - " AND description ~ '^Compliant:[\\s]*NO[\\s]*') > 0" + " AND description ~ '^Compliant:\\s*NO\\s*') > 0" " THEN RETURN 'no';" " WHEN (SELECT count(*) FROM results" " WHERE report = report_id" - " AND description ~ '^Compliant:[\\s]*INCOMPLETE[\\s]*') > 0" + " AND description ~ '^Compliant:\\s*INCOMPLETE\\s*') > 0" " THEN RETURN 'incomplete';" " WHEN (SELECT count(*) FROM results" " WHERE report = report_id" - " AND description ~ '^Compliant:[\\s]*YES[\\s]*') > 0" + " AND description ~ '^Compliant:\\s*YES\\s*') > 0" " THEN RETURN 'yes';" " ELSE RETURN 'undefined';" " END CASE;" @@ -962,7 +962,7 @@ manage_create_sql_functions () " BEGIN" " WITH compliance_count AS" " (SELECT count(*) AS total FROM results WHERE report = report_id" - " AND description ~ ('^Compliant:[\\s]*' || compliance || '[\\s]*'))" + " AND description ~ ('^Compliant:\\s*' || compliance || '\\s*'))" " SELECT total FROM compliance_count" " INTO count;" " RETURN count;" diff --git a/src/manage_sql.c b/src/manage_sql.c index 59ae301f2..e59f2fd45 100644 --- a/src/manage_sql.c +++ b/src/manage_sql.c @@ -22118,7 +22118,7 @@ report_compliance_by_uuid (const char *report_id, *compliance_yes = sql_int ("SELECT count(*) FROM results" " WHERE report = %llu" - " AND description ~ '^Compliant:[\\s]*YES[\\s]*';", + " AND description ~ '^Compliant:\\s*YES\\s*';", report); } @@ -22127,7 +22127,7 @@ report_compliance_by_uuid (const char *report_id, *compliance_no = sql_int ("SELECT count(*) FROM results" " WHERE report = %llu" - " AND description ~ '^Compliant:[\\s]*NO[\\s]*';", + " AND description ~ '^Compliant:\\s*NO\\s*';", report); } @@ -22136,7 +22136,7 @@ report_compliance_by_uuid (const char *report_id, *compliance_incomplete = sql_int ("SELECT count(*) FROM results" " WHERE report = %llu" - " AND description ~ '^Compliant:[\\s]*INCOMPLETE[\\s]*';", + " AND description ~ '^Compliant:\\s*INCOMPLETE\\s*';", report); } if (compliance_undefined) @@ -22144,7 +22144,7 @@ report_compliance_by_uuid (const char *report_id, *compliance_undefined = sql_int ("SELECT count(*) FROM results" " WHERE report = %llu" - " AND description !~ '^Compliant:[\\s]*';", + " AND description !~ '^Compliant:\\s*';", report); }