SQLUndercover / UndercoverToolbox

A collection of cool and useful tools, procedures and scripts for the discerning DBA
https://sqlundercover.com
MIT License
84 stars 40 forks source link

Inspector - Custom modules contain the wrong definition for GetServerModuleThreshold function #266

Closed Adedba closed 3 years ago

Adedba commented 3 years ago

When we introduced the server thresholds functionality in #263 there was a small bug that was fixed prior to the merge commit into master, the bug only affected the threshold for Diff backups and the value of NULL trouble is the custom modules also had the create/alter function contained within their installation but had the old revision with the bug.

After discovering this I decided that its bad practice to work this way so instead the core Inspector definitions for objects will only be contained within the inspector install and the custom modules will now only check for existence of the objects, if the required objects do not exists then an error is raised for the custom module upon install.

Adedba commented 3 years ago

This bug will only occur if you install/update one of the custom modules (CPU and BlitzWaits) following install/Update to the latest Inspector version, this is because the definitions within these two modules for the GetServerModuleThreshold function was an old definition , a reinstall of the Inspector will fix it or simple altering the function to the latest revision.

The bug only affects the threshold DiffBackupThreshold when the value is set to NULL, other thresholds are unaffected including DiffBackupThreshold with a value other than NULL.