Skip to content

Commit 3bcc848

Browse files
sp_HumanEvents: restore 1/0 idiom in CATCH session-existence EXISTS checks
PR #808 changed SELECT 1/0 to SELECT 1 in the two EXISTS checks on a reviewer suggestion, but the SELECT list inside EXISTS is never evaluated, so there is no divide-by-zero risk. 1/0 is the house style for EXISTS in this codebase; revert both checks to it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent a329b69 commit 3bcc848

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

sp_HumanEvents/sp_HumanEvents.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5022,7 +5022,7 @@ BEGIN CATCH
50225022
WHEN EXISTS
50235023
(
50245024
SELECT
5025-
1
5025+
1/0
50265026
FROM sys.server_event_sessions AS ses
50275027
WHERE ses.name = @session_name
50285028
)
@@ -5038,7 +5038,7 @@ BEGIN CATCH
50385038
WHEN EXISTS
50395039
(
50405040
SELECT
5041-
1
5041+
1/0
50425042
FROM sys.database_event_sessions AS ses
50435043
WHERE ses.name = @session_name
50445044
)

0 commit comments

Comments
 (0)