From eb693710c52a78a81a15ad1b2b15c96141230b36 Mon Sep 17 00:00:00 2001 From: jacktengg <18241664+jacktengg@users.noreply.github.com> Date: Fri, 17 Mar 2023 15:50:27 +0800 Subject: [PATCH] [fix](coalesce) fix problem that coalesce function may cause problem of block mem reuse --- be/src/vec/functions/function_coalesce.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/be/src/vec/functions/function_coalesce.cpp b/be/src/vec/functions/function_coalesce.cpp index c7edcd74ce0c0a..9c66dff293cf8d 100644 --- a/be/src/vec/functions/function_coalesce.cpp +++ b/be/src/vec/functions/function_coalesce.cpp @@ -68,9 +68,10 @@ class FunctionCoalesce : public IFunction { const auto& arg_type = block.get_by_position(arguments[i]).type; filtered_args.push_back(arguments[i]); if (!arg_type->is_nullable()) { - if (i == 0) { //if the first column not null, return it's directly + if (i == 0) { block.get_by_position(result).column = - block.get_by_position(arguments[0]).column; + block.get_by_position(arguments[0]) + .column->clone_resized(input_rows_count); return Status::OK(); } else { break;