Skip to content

dev → main: bug template @debug field + sp_IndexCleanup uptime/UDF fixes#770

Merged
erikdarlingdata merged 4 commits intomainfrom
dev
Apr 27, 2026
Merged

dev → main: bug template @debug field + sp_IndexCleanup uptime/UDF fixes#770
erikdarlingdata merged 4 commits intomainfrom
dev

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

Promotes two recently merged dev PRs to main:

  • Ask for @debug output in bug report template #768 — Add @debug output field to the bug report template. Asks reporters to re-run with @debug = 1 and paste the Messages-tab output, listing every proc that supports @debug. Pinpoints broken sections without follow-up round-trips.
  • sp_IndexCleanup: show uptime in header row, fix UDF false positives #769sp_IndexCleanup:
    • Surface server uptime alongside the run-date header row's consolidation_rule so the day count is visible per-row, not just in the summary database_info cell.
    • Replace the LIKE '%].[%(%' UDF-detection heuristic for computed columns and check constraints with a sys.sql_expression_dependencies join filtered to FN/IF/TF/FS/FT. The heuristic produced false positives for any definition containing ].[( — including string literals, OBJECT_ID(N'[schema].[name](x)'), and any system function called as [sys].[fn_xxx](). udf_names now reports a clean [schema].[name] list instead of a SUBSTRING-from-first-bracket extract.

Test plan

  • All status checks green on both source PRs (SQL Server 2017/2019/2022/2025 SQL Tests, branch check)
  • sp_IndexCleanup UDF detection validated end-to-end on SQL2022 against purpose-built false-positive bait (string literals with ].[(, OBJECT_ID literals with bracketed names, real UDF refs in both computed columns and check constraints) — see sp_IndexCleanup: show uptime in header row, fix UDF false positives #769 test plan

erikdarlingdata and others added 4 commits April 26, 2026 13:53
Add a Debug Output textarea to bug_report.yml asking reporters to
re-run with @debug = 1 and paste the Messages output. Lists all
procs that support @debug. The current_table value and failing
dynamic SQL pinpoint the broken section without further round-trips.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…g-heuristic UDF detection

Append a "Server uptime: N days" (or warning variant when uptime < 14 days)
clause to the run-date header row's consolidation_rule, so the day count is
visible alongside per-row warnings rather than only in the summary block.

Replace the LIKE '%].[%(%' heuristic that flagged computed columns and check
constraints as containing UDFs. The pattern fired on string literals containing
].[ ( bracketed schema-qualified system functions like [sys].[fn_xxx](), and
OBJECT_ID literals that include schema-qualified names. Use sys.sql_expression_dependencies
filtered to FN/IF/TF/FS/FT object types instead, joined to sys.objects for the
clean [schema].[name] list.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ection

sp_IndexCleanup: show uptime in header row, fix UDF false positives
@erikdarlingdata erikdarlingdata merged commit 65ecc79 into main Apr 27, 2026
9 checks passed
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.

1 participant