Use %I64d for bigint args in collector RAISERROR debug output (#987)#988
Merged
Conversation
RAISERROR's %d substitution accepts only int — passing a bigint silently produces no message, so every collector's @debug=1 row-count line printed nothing ("Commands completed successfully" with no output). @rows_collected is declared bigint and set from ROWCOUNT_BIG(), so the N'Collected %d ... rows' messages never rendered. Switched %d to %I64d for every RAISERROR argument whose variable is bigint (@rows_collected, @rows_updated, @rows_parsed, @events_from_file, @total_deleted, @duration_threshold_ms) across 31 install files — 35 substitutions. Multi-arg calls were fixed positionally: %d kept for genuine int arguments (@table_count, @trace_id, @property_count, etc.). Verified: full installer run against SQL2022 (54 files, 0 failures) and EXEC collect.cpu_utilization_stats_collector @debug=1 now prints "Collected 1 CPU utilization stats rows"; wait_stats prints its count too. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #987.
RAISERROR's%dsubstitution accepts onlyint— passing abigintsilently produces no message. Collector@rows_collectedis declaredbigintand set fromROWCOUNT_BIG(), so every collector's@debug=1row-count line (N'Collected %d ... rows') rendered nothing — the user saw only "Commands completed successfully".This is a diagnostic-output bug only. The Agent jobs never pass
@debug=1, so actual data collection was never affected — the messages were just invisible when a collector was run by hand.Changes
%d→%I64dsubstitutions across 31 install files, for everyRAISERRORargument whose variable isbigint(@rows_collected,@rows_updated,@rows_parsed,@events_from_file,@total_deleted,@duration_threshold_ms).%dkept for genuineintarguments (@table_count,@trace_id,@property_count, CPU-scheduler warning counters, etc.).%I64dwas already used correctly in a few places (23,25,43); this brings the rest in line.Test plan
EXEC collect.cpu_utilization_stats_collector @debug=1→Collected 1 CPU utilization stats rows(reporter's expected output).EXEC collect.wait_stats_collector @debug=1→Collected 84 wait stats rows.🤖 Generated with Claude Code