Skip to content
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

#3350 DBCC DBinfo fires incorrectly #3357

Merged

Conversation

Montro1981
Copy link
Contributor

@Montro1981 Montro1981 commented Sep 26, 2023

Fix for issue #3350

The old code had an logical error in it:

Check 233 is not in #BlitzResults
Check 2 is not in #SkipChecks
Check 68 is in #SkipChecks

It became:
IF True (Check 233 not in #BlitzResults)
AND
(
    True (Check 2 not in #SkipChecks)
    OR
    False (Check 68 in #SkipChecks)
)

So the IF returned true and the check fired.
Basically the OR needed to be an AND, this allowed the code to be simplified to:

IF NOT EXISTS
(
	SELECT	1/0 
	FROM	#BlitzResults 
	WHERE	CheckID = 223 AND URL = 'https://aws.amazon.com/rds/sqlserver/'
) AND NOT EXISTS
(
	SELECT  1/0
	FROM    #SkipChecks
	WHERE   DatabaseName IS NULL AND CheckID IN (2, 68)
)

Easier to read as well.

Copy link
Member

@BrentOzar BrentOzar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pull request! Wow, the logic in the original one makes my head hurt. Merging into the dev branch, will be in the next release with credit to you in the release notes.

@BrentOzar BrentOzar merged commit acc9b22 into BrentOzarULTD:dev Oct 10, 2023
@Montro1981 Montro1981 deleted the SQL-Server-First-Responder-Kit_3350 branch October 11, 2023 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants