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

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


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new 2a97accb333 branch-3.0: [Bug](function) fix repeat function result 
length is invalid and cause overflow #45288 (#45443)
2a97accb333 is described below

commit 2a97accb3337505cd6bd20f4bbc56f0cd285bbcb
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Dec 17 19:05:58 2024 +0800

    branch-3.0: [Bug](function) fix repeat function result length is invalid 
and cause overflow #45288 (#45443)
    
    Cherry-picked from #45288
    
    Co-authored-by: zhangstar333 <zhangs...@selectdb.com>
---
 be/src/vec/functions/function_string.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/be/src/vec/functions/function_string.h 
b/be/src/vec/functions/function_string.h
index 1b803407b60..195ef4af76b 100644
--- a/be/src/vec/functions/function_string.h
+++ b/be/src/vec/functions/function_string.h
@@ -1526,6 +1526,9 @@ public:
     static FunctionPtr create() { return 
std::make_shared<FunctionStringRepeat>(); }
     String get_name() const override { return name; }
     size_t get_number_of_arguments() const override { return 2; }
+    // should set NULL value of nested data to default,
+    // as iff it's not inited and invalid, the repeat result of length is so 
large cause overflow
+    bool need_replace_null_data_to_default() const override { return true; }
 
     DataTypePtr get_return_type_impl(const DataTypes& arguments) const 
override {
         return make_nullable(std::make_shared<DataTypeString>());


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

Reply via email to