Commit f6f0778
Fix 27 logical bugs across all 10 stored procedures
Bugs found via automated review, validated one-by-one against SQL2022:
- sp_HealthParser: Fix XPath inputbuf extraction
- sp_HumanEvents: Fix memory filter, CATCH cleanup, QUOTENAME schema/table
- sp_HumanEventsBlockViewer: Fix table mode XML, DATEADD overflow guard
- sp_LogHunter: Add archive > 0 guard
- sp_IndexCleanup: Fix LEN trailing space (use DATALENGTH), fix t.max_length
vs c.max_length for detecting (max) columns
- sp_PerfCheck: Fix NULL @processors check, TOKENANDPERMUSERSTORE priority
gap, wrap DMV queries in VIEW SERVER STATE guard
- sp_QueryReproBuilder: Fix version gates from @new to @sql_2017 for columns
available since SQL 2017
- sp_QueryStoreCleanup: Fix COUNT_BIG(*) false positives with COUNT(DISTINCT)
(39% false positive rate eliminated)
- sp_QuickieStore: Fix cursor FETCH NEXT/CONTINUE for @get_all_databases,
remove compile memory 8x inflation, fix log bytes 95x deflation, remove
duplicate TRUNCATEs, add @@DATEFIRST ELSE warning for @workdays
- sp_PressureDetector: Add missing SET LOCK_TIMEOUT -1, fix DATEDIFF
divide-by-zero, fix sampled avg_ms_per_wait delta calculation, fix @Prefix
NULL on Azure
All 10 procedures installed and executed successfully on SQL2022.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 01644dc commit f6f0778
10 files changed
Lines changed: 109 additions & 74 deletions
File tree
- sp_HealthParser
- sp_HumanEvents
- sp_IndexCleanup
- sp_LogHunter
- sp_PerfCheck
- sp_PressureDetector
- sp_QueryReproBuilder
- sp_QueryStoreCleanup
- sp_QuickieStore
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5677 | 5677 | | |
5678 | 5678 | | |
5679 | 5679 | | |
5680 | | - | |
| 5680 | + | |
5681 | 5681 | | |
5682 | 5682 | | |
5683 | 5683 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1544 | 1544 | | |
1545 | 1545 | | |
1546 | 1546 | | |
1547 | | - | |
| 1547 | + | |
| 1548 | + | |
1548 | 1549 | | |
1549 | 1550 | | |
1550 | 1551 | | |
| |||
3754 | 3755 | | |
3755 | 3756 | | |
3756 | 3757 | | |
3757 | | - | |
| 3758 | + | |
3758 | 3759 | | |
3759 | 3760 | | |
3760 | 3761 | | |
| |||
4105 | 4106 | | |
4106 | 4107 | | |
4107 | 4108 | | |
4108 | | - | |
| 4109 | + | |
4109 | 4110 | | |
4110 | 4111 | | |
4111 | 4112 | | |
| |||
4848 | 4849 | | |
4849 | 4850 | | |
4850 | 4851 | | |
4851 | | - | |
| 4852 | + | |
4852 | 4853 | | |
4853 | 4854 | | |
4854 | 4855 | | |
| |||
4879 | 4880 | | |
4880 | 4881 | | |
4881 | 4882 | | |
4882 | | - | |
| 4883 | + | |
4883 | 4884 | | |
4884 | 4885 | | |
4885 | 4886 | | |
| |||
4912 | 4913 | | |
4913 | 4914 | | |
4914 | 4915 | | |
4915 | | - | |
| 4916 | + | |
4916 | 4917 | | |
4917 | 4918 | | |
4918 | 4919 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1835 | 1835 | | |
1836 | 1836 | | |
1837 | 1837 | | |
1838 | | - | |
1839 | | - | |
1840 | | - | |
| 1838 | + | |
1841 | 1839 | | |
1842 | 1840 | | |
1843 | 1841 | | |
| |||
3622 | 3620 | | |
3623 | 3621 | | |
3624 | 3622 | | |
3625 | | - | |
| 3623 | + | |
3626 | 3624 | | |
3627 | 3625 | | |
3628 | 3626 | | |
| |||
3711 | 3709 | | |
3712 | 3710 | | |
3713 | 3711 | | |
3714 | | - | |
| 3712 | + | |
3715 | 3713 | | |
3716 | 3714 | | |
3717 | 3715 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1027 | 1027 | | |
1028 | 1028 | | |
1029 | 1029 | | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
1030 | 1040 | | |
1031 | 1041 | | |
1032 | 1042 | | |
| |||
1135 | 1145 | | |
1136 | 1146 | | |
1137 | 1147 | | |
1138 | | - | |
| 1148 | + | |
1139 | 1149 | | |
1140 | 1150 | | |
1141 | | - | |
| 1151 | + | |
1142 | 1152 | | |
1143 | 1153 | | |
1144 | 1154 | | |
| |||
1380 | 1390 | | |
1381 | 1391 | | |
1382 | 1392 | | |
| 1393 | + | |
| 1394 | + | |
1383 | 1395 | | |
1384 | 1396 | | |
1385 | 1397 | | |
| |||
2178 | 2190 | | |
2179 | 2191 | | |
2180 | 2192 | | |
2181 | | - | |
| 2193 | + | |
2182 | 2194 | | |
2183 | 2195 | | |
2184 | 2196 | | |
| |||
3374 | 3386 | | |
3375 | 3387 | | |
3376 | 3388 | | |
3377 | | - | |
3378 | | - | |
3379 | | - | |
3380 | | - | |
3381 | | - | |
3382 | | - | |
3383 | | - | |
3384 | | - | |
3385 | | - | |
3386 | | - | |
3387 | 3389 | | |
3388 | 3390 | | |
3389 | 3391 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
370 | | - | |
371 | | - | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
372 | 373 | | |
373 | 374 | | |
374 | 375 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
990 | 990 | | |
991 | 991 | | |
992 | 992 | | |
| 993 | + | |
| 994 | + | |
993 | 995 | | |
994 | 996 | | |
995 | 997 | | |
| |||
1101 | 1103 | | |
1102 | 1104 | | |
1103 | 1105 | | |
1104 | | - | |
| 1106 | + | |
1105 | 1107 | | |
1106 | 1108 | | |
1107 | 1109 | | |
| |||
1130 | 1132 | | |
1131 | 1133 | | |
1132 | 1134 | | |
| 1135 | + | |
1133 | 1136 | | |
1134 | 1137 | | |
1135 | 1138 | | |
| |||
3306 | 3309 | | |
3307 | 3310 | | |
3308 | 3311 | | |
3309 | | - | |
| 3312 | + | |
| 3313 | + | |
3310 | 3314 | | |
3311 | 3315 | | |
3312 | 3316 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
441 | 441 | | |
442 | 442 | | |
443 | 443 | | |
| 444 | + | |
444 | 445 | | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
455 | 459 | | |
456 | 460 | | |
457 | 461 | | |
| |||
1452 | 1456 | | |
1453 | 1457 | | |
1454 | 1458 | | |
1455 | | - | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
1456 | 1469 | | |
1457 | 1470 | | |
1458 | 1471 | | |
| |||
2106 | 2119 | | |
2107 | 2120 | | |
2108 | 2121 | | |
2109 | | - | |
| 2122 | + | |
2110 | 2123 | | |
2111 | | - | |
2112 | | - | |
2113 | | - | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
2114 | 2131 | | |
2115 | 2132 | | |
2116 | 2133 | | |
| |||
3932 | 3949 | | |
3933 | 3950 | | |
3934 | 3951 | | |
3935 | | - | |
| 3952 | + | |
| 3953 | + | |
| 3954 | + | |
| 3955 | + | |
3936 | 3956 | | |
3937 | 3957 | | |
3938 | 3958 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1770 | 1770 | | |
1771 | 1771 | | |
1772 | 1772 | | |
1773 | | - | |
| 1773 | + | |
1774 | 1774 | | |
1775 | 1775 | | |
1776 | 1776 | | |
| |||
1911 | 1911 | | |
1912 | 1912 | | |
1913 | 1913 | | |
1914 | | - | |
| 1914 | + | |
1915 | 1915 | | |
1916 | 1916 | | |
1917 | 1917 | | |
| |||
2210 | 2210 | | |
2211 | 2211 | | |
2212 | 2212 | | |
2213 | | - | |
| 2213 | + | |
2214 | 2214 | | |
2215 | 2215 | | |
2216 | 2216 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
563 | 563 | | |
564 | 564 | | |
565 | 565 | | |
566 | | - | |
| 566 | + | |
567 | 567 | | |
568 | 568 | | |
569 | 569 | | |
| |||
585 | 585 | | |
586 | 586 | | |
587 | 587 | | |
588 | | - | |
| 588 | + | |
589 | 589 | | |
590 | 590 | | |
591 | 591 | | |
| |||
627 | 627 | | |
628 | 628 | | |
629 | 629 | | |
630 | | - | |
| 630 | + | |
631 | 631 | | |
632 | 632 | | |
633 | 633 | | |
| |||
649 | 649 | | |
650 | 650 | | |
651 | 651 | | |
652 | | - | |
| 652 | + | |
653 | 653 | | |
654 | 654 | | |
655 | 655 | | |
| |||
0 commit comments