erikdarlingdata / DarlingData

Open source SQL Server nonsense: sp_PressureDetector, sp_QuickieStore, sp_HumanEvents, etc.
https://www.erikdarling.com/
MIT License
443 stars 132 forks source link

sp_QuickieStore: @get_all_databases = 1 seems to ignore the time part of @start_date and @end_date #429

Closed ReeceGoding closed 1 month ago

ReeceGoding commented 1 month ago

Version of the script 4.5.

What is the current behavior? Run sp_quickiestore @get_all_databases = 1, @start_date = '20240511 12:00:00', @end_date = '20240511 13:00:00' and look at the results. On my machine, every result that I get is on the given date, but the time part is seemingly ignored. For example, I can see executions that had their first and last times at 5 AM.

If you specify @database_name, the problem disappears.

If the current behavior is a bug, please provide the steps to reproduce. As above.

What is the expected behavior? @get_all_databases = 1 should fully respect @start_date and @end_date.

Which versions of SQL Server and which OS are affected by this issue? Did this work in previous versions of our procedures? I doubt this is version dependent.

IMPORTANT: If you're going to contribute code, please read the contributing guide first. https://github.com/erikdarlingdata/DarlingData/blob/main/CONTRIBUTING.md Will do, if I end up trying to fix this myself.

ReeceGoding commented 1 month ago

My guess is that the UTC adjustment is being applied multiple times. It can't be a coincidence that the @debug = 1 outputs shows that my eighth database is showing data from 05:00 when I'm asking for 13:00.