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

cambyzju pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new c2517147886 [fix](crash) be crash because of duplicate 
__PARTIAL_UPDATE_AUTO_INC_COLUMN__ (#41172)
c2517147886 is described below

commit c2517147886f9d57fe0694c65a3cae42b6174cb8
Author: camby <camby...@tencent.com>
AuthorDate: Wed Sep 25 22:29:51 2024 +0800

    [fix](crash) be crash because of duplicate 
__PARTIAL_UPDATE_AUTO_INC_COLUMN__ (#41172)
---
 be/src/common/consts.h                      | 1 +
 be/src/olap/partial_update_info.cpp         | 3 ++-
 be/src/vec/sink/vtablet_block_convertor.cpp | 9 +++++++--
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/be/src/common/consts.h b/be/src/common/consts.h
index dfee235e37b..2ec9ae12679 100644
--- a/be/src/common/consts.h
+++ b/be/src/common/consts.h
@@ -29,6 +29,7 @@ const std::string BLOCK_TEMP_COLUMN_SCANNER_FILTERED = 
"__TEMP__scanner_filtered
 const std::string ROWID_COL = "__DORIS_ROWID_COL__";
 const std::string ROW_STORE_COL = "__DORIS_ROW_STORE_COL__";
 const std::string DYNAMIC_COLUMN_NAME = "__DORIS_DYNAMIC_COL__";
+const std::string PARTIAL_UPDATE_AUTO_INC_COL = 
"__PARTIAL_UPDATE_AUTO_INC_COLUMN__";
 
 /// The maximum precision representable by a 4-byte decimal (Decimal4Value)
 constexpr int MAX_DECIMAL32_PRECISION = 9;
diff --git a/be/src/olap/partial_update_info.cpp 
b/be/src/olap/partial_update_info.cpp
index b8e528e99e1..247353103df 100644
--- a/be/src/olap/partial_update_info.cpp
+++ b/be/src/olap/partial_update_info.cpp
@@ -19,6 +19,7 @@
 
 #include <gen_cpp/olap_file.pb.h>
 
+#include "common/consts.h"
 #include "olap/base_tablet.h"
 #include "olap/olap_common.h"
 #include "olap/rowset/rowset.h"
@@ -306,7 +307,7 @@ Status PartialUpdateReadPlan::fill_missing_columns(
                             assert_cast<vectorized::ColumnInt64*, 
TypeCheckOnRelease::DISABLE>(missing_col.get());
                     auto_inc_column->insert(
                             (assert_cast<const vectorized::ColumnInt64*, 
TypeCheckOnRelease::DISABLE>(
-                                     
block->get_by_name("__PARTIAL_UPDATE_AUTO_INC_COLUMN__").column.get()))->get_element(idx));
+                                     
block->get_by_name(BeConsts::PARTIAL_UPDATE_AUTO_INC_COL).column.get()))->get_element(idx));
                 } else {
                     // If the control flow reaches this branch, the column 
neither has default value
                     // nor is nullable. It means that the row's delete sign is 
marked, and the value
diff --git a/be/src/vec/sink/vtablet_block_convertor.cpp 
b/be/src/vec/sink/vtablet_block_convertor.cpp
index 36d9a034cf7..820759af2e4 100644
--- a/be/src/vec/sink/vtablet_block_convertor.cpp
+++ b/be/src/vec/sink/vtablet_block_convertor.cpp
@@ -29,6 +29,7 @@
 #include <utility>
 
 #include "common/compiler_util.h" // IWYU pragma: keep
+#include "common/consts.h"
 #include "common/status.h"
 #include "runtime/descriptors.h"
 #include "runtime/runtime_state.h"
@@ -556,6 +557,10 @@ Status 
OlapTableBlockConvertor::_fill_auto_inc_cols(vectorized::Block* block, si
 
 Status 
OlapTableBlockConvertor::_partial_update_fill_auto_inc_cols(vectorized::Block* 
block,
                                                                    size_t 
rows) {
+    // avoid duplicate PARTIAL_UPDATE_AUTO_INC_COL
+    if (block->has(BeConsts::PARTIAL_UPDATE_AUTO_INC_COL)) {
+        return Status::OK();
+    }
     auto dst_column = vectorized::ColumnInt64::create();
     vectorized::ColumnInt64::Container& dst_values = dst_column->get_data();
     size_t null_value_count = rows;
@@ -570,8 +575,8 @@ Status 
OlapTableBlockConvertor::_partial_update_fill_auto_inc_cols(vectorized::B
     }
     block->insert(vectorized::ColumnWithTypeAndName(std::move(dst_column),
                                                     
std::make_shared<DataTypeNumber<Int64>>(),
-                                                    
"__PARTIAL_UPDATE_AUTO_INC_COLUMN__"));
+                                                    
BeConsts::PARTIAL_UPDATE_AUTO_INC_COL));
     return Status::OK();
 }
 
-} // namespace doris::vectorized
\ No newline at end of file
+} // namespace doris::vectorized


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

Reply via email to