Skip to content

Commit

Permalink
Merge pull request #3580 from Tisit/Issue3578
Browse files Browse the repository at this point in the history
sp_Blitz: Check 191 avoid false positives in case user doesn't have permissions on sys.master_files
  • Loading branch information
BrentOzar authored Oct 14, 2024
2 parents 8fdf5f1 + 1a73cb4 commit 8e70e5d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sp_Blitz.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6105,6 +6105,8 @@ IF @ProductVersionMajor >= 10
FROM #SkipChecks
WHERE DatabaseName IS NULL AND CheckID = 191 )
AND (SELECT COUNT(*) FROM sys.master_files WHERE database_id = 2) <> (SELECT COUNT(*) FROM tempdb.sys.database_files)
/* User may have no permissions to see tempdb files in sys.master_files. In that case count returned will be 0 and we want to skip the check */
AND (SELECT COUNT(*) FROM sys.master_files WHERE database_id = 2) <> 0
BEGIN

IF @Debug IN (1, 2) RAISERROR('Running CheckId [%d].', 0, 1, 191) WITH NOWAIT
Expand Down

0 comments on commit 8e70e5d

Please sign in to comment.