mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Fixed fuzz test #4322
This commit is contained in:
parent
49165b1347
commit
2294575693
@ -12,8 +12,13 @@ namespace DB
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int ILLEGAL_TYPE_OF_ARGUMENT;
|
||||
extern const int TOO_LARGE_ARRAY_SIZE;
|
||||
}
|
||||
|
||||
/// Reasonable threshold.
|
||||
static constexpr size_t max_arrays_size_in_block = 1000000000;
|
||||
|
||||
|
||||
/* arrayWithConstant(num, const) - make array of constants with length num.
|
||||
* arrayWithConstant(3, 'hello') = ['hello', 'hello', 'hello']
|
||||
* arrayWithConstant(1, 'hello') = ['hello']
|
||||
@ -55,6 +60,8 @@ public:
|
||||
for (size_t i = 0; i < num_rows; ++i)
|
||||
{
|
||||
offset += col_num->getUInt(i);
|
||||
if (unlikely(offset > max_arrays_size_in_block))
|
||||
throw Exception("Too large array size while executing function " + getName(), ErrorCodes::TOO_LARGE_ARRAY_SIZE);
|
||||
offsets.push_back(offset);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1 @@
|
||||
SELECT arrayWithConstant(-231.37104, -138); -- { serverError 128 }
|
Loading…
Reference in New Issue
Block a user