-
Notifications
You must be signed in to change notification settings - Fork 734
fix(vulnerabilities): coalesce summary and details for description field #3990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -18,7 +18,7 @@ SQL > | |||||
| any (arrayElement(v.cveIds, 1)) as cveId, | ||||||
| any (v.packageName) as packageName, | ||||||
| any (v.severity) as severity, | ||||||
| any (v.summary) as description, | ||||||
| coalesce(any (v.summary), any (v.details)) as description, | ||||||
|
||||||
| coalesce(any (v.summary), any (v.details)) as description, | |
| any(coalesce(v.summary, v.details)) as description, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
coalesce never falls back because column is non-nullable
High Severity
coalesce(any(v.summary), any(v.details))will never fall back tov.detailsbecause thesummarycolumn is defined as a non-nullableStringwithDEFAULT ''in the datasource. Theany()aggregate on a non-nullable string column returns''(not NULL) when the value is empty, andcoalesceonly substitutes NULL values. The fallback is effectively dead code. Something likenullIfwould be needed to convert empty strings to NULL beforecoalescecan work as intended.