This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new 1079af3e8a9 [fix](func)fix array_with_const with larger than 
max_array_size #37495 (#38150)
1079af3e8a9 is described below

commit 1079af3e8a99ea3dadb5889a26609567b4b85fa9
Author: amory <wangqian...@selectdb.com>
AuthorDate: Sun Jul 28 19:20:34 2024 +0800

    [fix](func)fix array_with_const with larger than max_array_size #37495 
(#38150)
---
 be/src/vec/functions/array/function_array_with_constant.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/be/src/vec/functions/array/function_array_with_constant.cpp 
b/be/src/vec/functions/array/function_array_with_constant.cpp
index 9e3885b1c3c..724f3cc1316 100644
--- a/be/src/vec/functions/array/function_array_with_constant.cpp
+++ b/be/src/vec/functions/array/function_array_with_constant.cpp
@@ -92,9 +92,9 @@ public:
         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);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to