Skip to content

Commit

Permalink
[fix](func)fix array_with_const with larger than max_array_size #37495 (
Browse files Browse the repository at this point in the history
  • Loading branch information
amorynan authored Jul 28, 2024
1 parent b8770ee commit 1079af3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions be/src/vec/functions/array/function_array_with_constant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ class FunctionArrayWithConstant : public IFunction {
array_sizes.reserve(input_rows_count);
for (size_t i = 0; i < input_rows_count; ++i) {
auto array_size = num->get_int(i);
if (UNLIKELY(array_size < 0)) {
return Status::RuntimeError("Array size can not be negative in function:" +
get_name());
if (UNLIKELY(array_size < 0) || UNLIKELY(array_size > max_array_size_as_field)) {
return Status::RuntimeError("Array size should in range(0, {}) in function: {}",
max_array_size_as_field, get_name());
}
offset += array_size;
offsets.push_back(offset);
Expand Down

0 comments on commit 1079af3

Please sign in to comment.