未验证 提交 0e420605 编写于 作者: A alexey-milovidov 提交者: GitHub

Merge pull request #22114 from ucasFL/bar

Fix bar with invalid float value
......@@ -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]));
......
SELECT greatCircleAngle(1048575, 257, -9223372036854775808, 1048576) - NULL, bar(7, -inf, 1024); -- { serverError 36 }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册