This commit is contained in:
Nikita Mikhailov 2020-12-25 18:54:38 +03:00
parent ff80c1f3ce
commit 2239f9b0c6
3 changed files with 9 additions and 2 deletions

View File

@ -7,6 +7,8 @@
#include <Common/FieldVisitors.h>
#include <IO/WriteHelpers.h>
#include <iostream>
namespace DB
{
@ -75,11 +77,14 @@ public:
/// The maximum width of the bar in characters, by default.
Float64 max_width = arguments.size() == 4 ? extractConstant<Float64>(arguments, 3, "Fourth") : 80;
if (isNaN(max_width))
throw Exception("Argument 'max_width' must not be NaN", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
if (max_width < 1)
throw Exception("Max_width argument must be >= 1.", ErrorCodes::ARGUMENT_OUT_OF_BOUND);
throw Exception("Argument 'max_width' must be >= 1", ErrorCodes::ARGUMENT_OUT_OF_BOUND);
if (max_width > 1000)
throw Exception("Too large max_width.", ErrorCodes::ARGUMENT_OUT_OF_BOUND);
throw Exception("Argument 'max_width' must be <= 1000", ErrorCodes::ARGUMENT_OUT_OF_BOUND);
const auto & src = *arguments[0].column;

View File

@ -0,0 +1,2 @@
SELECT bar((greatCircleAngle(65537, 2, 1, 1) - 1) * 65535, 1048576, 1048577, nan); -- { serverError 43 }
select bar(1,1,1,nan); -- { serverError 43 }