mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
Fix bar with invalid float value
fix
This commit is contained in:
parent
94dabbac60
commit
55ba4ec15e
@ -16,6 +16,7 @@ namespace ErrorCodes
|
||||
extern const int ARGUMENT_OUT_OF_BOUND;
|
||||
extern const int ILLEGAL_COLUMN;
|
||||
extern const int ILLEGAL_TYPE_OF_ARGUMENT;
|
||||
extern const int BAD_ARGUMENTS;
|
||||
}
|
||||
|
||||
namespace
|
||||
@ -110,6 +111,9 @@ public:
|
||||
arguments[2].column->getFloat64(i),
|
||||
max_width);
|
||||
|
||||
if (!isFinite(width))
|
||||
throw Exception("Value of width must not be NaN and Inf", ErrorCodes::BAD_ARGUMENTS);
|
||||
|
||||
size_t next_size = current_offset + UnicodeBar::getWidthInBytes(width) + 1;
|
||||
dst_chars.resize(next_size);
|
||||
UnicodeBar::render(width, reinterpret_cast<char *>(&dst_chars[current_offset]));
|
||||
|
@ -0,0 +1 @@
|
||||
SELECT greatCircleAngle(1048575, 257, -9223372036854775808, 1048576) - NULL, bar(7, -inf, 1024); -- { serverError 36 }
|
Loading…
Reference in New Issue
Block a user