Fix bar with invalid float value

fix
This commit is contained in:
feng lv 2021-03-25 10:41:03 +00:00
parent 94dabbac60
commit 55ba4ec15e
3 changed files with 5 additions and 0 deletions

View File

@ -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]));

View File

@ -0,0 +1 @@
SELECT greatCircleAngle(1048575, 257, -9223372036854775808, 1048576) - NULL, bar(7, -inf, 1024); -- { serverError 36 }