Skip to content

Commit

Permalink
restore use of TRUE
Browse files Browse the repository at this point in the history
  • Loading branch information
sgress454 committed Jan 24, 2025
1 parent 6a4e6e5 commit ef44102
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions server/datastore/mysql/software_titles.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@ GROUP BY st.id, package_self_service, package_name, package_version, package_url
vppAppsTeamsJoinCond = "FALSE"
}

additionalWhere := ""
additionalWhere := "TRUE"

match := opt.ListOptions.MatchQuery
softwareJoin := ""
if match != "" || opt.VulnerableOnly {
Expand Down Expand Up @@ -413,16 +414,8 @@ GROUP BY st.id, package_self_service, package_name, package_version, package_url
// if excluding fleet maintained apps, join on the fleet_library_apps table by bundle ID
// and filter out any row from software_titles that has a matching row in fleet_library_apps.
if opt.ExcludeFleetMaintainedApps {
softwareJoin += `LEFT JOIN fleet_library_apps fla ON st.bundle_identifier = fla.bundle_identifier`
if additionalWhere != "" {
additionalWhere += " AND "
}
additionalWhere += "fla.id is NULL"
}

// Default additionalWhere to "TRUE"
if additionalWhere == "" {
additionalWhere = "TRUE"
softwareJoin += ` LEFT JOIN fleet_library_apps fla ON st.bundle_identifier = fla.bundle_identifier`
additionalWhere += " fla.id is NULL"
}

stmt = fmt.Sprintf(stmt, softwareInstallersJoinCond, vppAppsJoinCond, vppAppsTeamsJoinCond, countsJoin, softwareJoin, additionalWhere, defaultFilter)
Expand Down

0 comments on commit ef44102

Please sign in to comment.