This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push:
new 7550fbaff7d [Fix](Exception) throw exception in defer may result
std::terminate (… (#39007)
7550fbaff7d is described below
commit 7550fbaff7d721f1b1b185936a11c63fc67f0a7b
Author: lihangyu <[email protected]>
AuthorDate: Wed Aug 7 13:46:23 2024 +0800
[Fix](Exception) throw exception in defer may result std::terminate (…
(#39007)
pick #38935
---
be/src/vec/functions/function_variant_element.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/be/src/vec/functions/function_variant_element.cpp
b/be/src/vec/functions/function_variant_element.cpp
index faa56ccb1e3..22bf45beb5e 100644
--- a/be/src/vec/functions/function_variant_element.cpp
+++ b/be/src/vec/functions/function_variant_element.cpp
@@ -103,11 +103,11 @@ private:
static Status get_element_column(const ColumnObject& src, const ColumnPtr&
index_column,
ColumnPtr* result) {
std::string field_name = index_column->get_data_at(0).to_string();
- Defer finalize([&]() { (*result)->assume_mutable()->finalize(); });
if (src.empty()) {
*result = ColumnObject::create(true);
// src subcolumns empty but src row count may not be 0
(*result)->assume_mutable()->insert_many_defaults(src.size());
+ (*result)->assume_mutable()->finalize();
return Status::OK();
}
if (src.is_scalar_variant() &&
@@ -132,6 +132,7 @@ private:
}
}
*result = ColumnObject::create(true, type,
std::move(result_column));
+ (*result)->assume_mutable()->finalize();
return Status::OK();
} else {
auto mutable_src = src.clone_finalized();
@@ -173,6 +174,7 @@ private:
result_col->insert_many_defaults(src.size());
}
*result = result_col->get_ptr();
+ (*result)->assume_mutable()->finalize();
VLOG_DEBUG << "dump new object "
<< static_cast<const
ColumnObject*>(result_col.get())->debug_string()
<< ", path " << path.get_path();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]