mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
fix sleep with infinite input
This commit is contained in:
parent
af4afff723
commit
2094eae23d
@ -78,8 +78,8 @@ public:
|
||||
|
||||
Float64 seconds = applyVisitor(FieldVisitorConvertToNumber<Float64>(), assert_cast<const ColumnConst &>(*col).getField());
|
||||
|
||||
if (seconds < 0)
|
||||
throw Exception("Cannot sleep negative amount of time (not implemented)", ErrorCodes::BAD_ARGUMENTS);
|
||||
if (seconds < 0 || !std::isfinite(seconds))
|
||||
throw Exception("Cannot sleep infinite or negative amount of time (not implemented)", ErrorCodes::BAD_ARGUMENTS);
|
||||
|
||||
size_t size = col->size();
|
||||
|
||||
|
2
tests/queries/0_stateless/01655_sleep_infinite_float.sql
Normal file
2
tests/queries/0_stateless/01655_sleep_infinite_float.sql
Normal file
@ -0,0 +1,2 @@
|
||||
SELECT sleep(nan); -- { serverError 36 }
|
||||
SELECT sleep(inf); -- { serverError 36 }
|
Loading…
Reference in New Issue
Block a user