mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Merge pull request #22114 from ucasFL/bar
Fix bar with invalid float value
This commit is contained in:
commit
0e42060523
@ -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