diff --git a/src/Functions/sleep.h b/src/Functions/sleep.h index fba8293e5ff..b7d4a1ab921 100644 --- a/src/Functions/sleep.h +++ b/src/Functions/sleep.h @@ -112,13 +112,15 @@ public: if (size > 0) { /// When sleeping, the query cannot be cancelled. For ability to cancel query, we limit sleep time. + UInt64 microseconds = static_cast(seconds * 1e6); if (max_microseconds && seconds * 1e6 > max_microseconds) - throw Exception(ErrorCodes::TOO_SLOW, "The maximum sleep time is {} microseconds. Requested: {}", max_microseconds, seconds); + throw Exception(ErrorCodes::TOO_SLOW, "The maximum sleep time is {} microseconds. Requested: {} microseconds", + max_microseconds, microseconds); if (!dry_run) { UInt64 count = (variant == FunctionSleepVariant::PerBlock ? 1 : size); - UInt64 microseconds = static_cast(seconds * count * 1e6); + microseconds = static_cast(seconds * count * 1e6); if (max_microseconds && microseconds > max_microseconds) throw Exception(ErrorCodes::TOO_SLOW,