Skip to content

Commit

Permalink
Dropping the brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
a-h-abdelsalam committed Jan 13, 2025
1 parent e1ff153 commit 816fa95
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/manage_pg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;"
Expand All @@ -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;"
Expand Down
8 changes: 4 additions & 4 deletions src/manage_sql.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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);
}

Expand All @@ -22136,15 +22136,15 @@ 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)
{
*compliance_undefined
= sql_int ("SELECT count(*) FROM results"
" WHERE report = %llu"
" AND description !~ '^Compliant:[\\s]*';",
" AND description !~ '^Compliant:\\s*';",
report);
}

Expand Down

0 comments on commit 816fa95

Please sign in to comment.