Skip to content

Commit 2f23916

Browse files
Merge fix/healthparser-deadlock-filter-and into dev
2 parents 731c746 + dc6e56d commit 2f23916

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

sp_HealthParser/sp_HealthParser.sql

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5728,9 +5728,16 @@ AND ca.utc_timestamp < @end_date';
57285728
FROM #deadlocks AS d
57295729
CROSS APPLY d.xml_deadlock_report.nodes('//deadlock/process-list/process') AS e(x)
57305730
) AS x
5731+
/* Standard "filter if supplied, pass-through if NULL" predicate
5732+
pairs must be combined with AND between the groups — OR let
5733+
rows through whenever either parameter was NULL, which makes
5734+
the @database_name/@dbid filter loose whenever only one side
5735+
was supplied. Currently masked because the validation block
5736+
above aborts when the two disagree, but the shape was
5737+
wrong and would break if that validation ever relaxed. */
57315738
WHERE (x.database_id = @dbid
57325739
OR @dbid IS NULL)
5733-
OR (x.current_database_name = @database_name
5740+
AND (x.current_database_name = @database_name
57345741
OR @database_name IS NULL)
57355742
OPTION(RECOMPILE, MAXDOP 1);
57365743

0 commit comments

Comments
 (0)