You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by ya...@apache.org on 2020/12/08 02:00:20 UTC

[incubator-doris] branch master updated: Fix a core dump introduced by pr #5022 (#5032)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new eb0cb04  Fix a core dump  introduced by pr #5022 (#5032)
eb0cb04 is described below

commit eb0cb04a70e31454c8053e19ba99c48a2e31dc2f
Author: Zhengguo Yang <ya...@gmail.com>
AuthorDate: Tue Dec 8 10:00:07 2020 +0800

    Fix a core dump  introduced by pr #5022 (#5032)
    
    * fix a core dump caused by pr #5022
---
 be/CMakeLists.txt                          |  2 +-
 be/src/olap/rowset/alpha_rowset_reader.cpp | 11 ++++++-----
 be/src/olap/rowset/column_data.cpp         |  6 +++---
 be/src/olap/rowset/column_data.h           |  4 ++--
 4 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt
index bf2762c..f0a86ed 100644
--- a/be/CMakeLists.txt
+++ b/be/CMakeLists.txt
@@ -300,7 +300,7 @@ set(CXX_GCC_FLAGS "${CXX_GCC_FLAGS} -g -Wno-unused-local-typedefs")
 # Debug information is stored as dwarf2 to be as compatible as possible
 #   -Werror: compile warnings should be errors when using the toolchain compiler.
 # Only enable for debug builds because this is what we test in pre-commit tests.
-set(CXX_FLAGS_DEBUG "${CXX_GCC_FLAGS} -Werror -ggdb -O0 -gdwarf-2")
+set(CXX_FLAGS_DEBUG "${CXX_GCC_FLAGS} -Werror -ggdb3 -O0 -gdwarf-2")
 
 # For CMAKE_BUILD_TYPE=Release
 #   -O3: Enable all compiler optimizations
diff --git a/be/src/olap/rowset/alpha_rowset_reader.cpp b/be/src/olap/rowset/alpha_rowset_reader.cpp
index 24e897b..8993861 100644
--- a/be/src/olap/rowset/alpha_rowset_reader.cpp
+++ b/be/src/olap/rowset/alpha_rowset_reader.cpp
@@ -354,17 +354,18 @@ OLAPStatus AlphaRowsetReader::_init_merge_ctxs(RowsetReaderContext* read_context
                 continue;
             }
         } else {
-            std::vector<ColumnPredicate*> predicates;
+            std::shared_ptr<std::vector<ColumnPredicate*>> predicates =
+                    std::make_shared<std::vector<ColumnPredicate*>>();
             if (read_context->predicates != nullptr) {
-                predicates.insert(predicates.end(), read_context->predicates->begin(),
-                                  read_context->predicates->end());
+                predicates->insert(predicates->end(), read_context->predicates->begin(),
+                                   read_context->predicates->end());
             }
             // if unique table with rowset [0-x] or [0-1] [2-y] [...],
             // value column predicates can be pushdown on rowset [0-x] or [2-y]
             if (read_context->value_predicates != nullptr && _rowset->keys_type() == UNIQUE_KEYS &&
                 (_rowset->start_version() == 0 || _rowset->start_version() == 2)) {
-                predicates.insert(predicates.end(), read_context->value_predicates->begin(),
-                                  read_context->value_predicates->end());
+                predicates->insert(predicates->end(), read_context->value_predicates->begin(),
+                                   read_context->value_predicates->end());
             }
             new_column_data->set_read_params(
                     *read_context->return_columns, *read_context->seek_columns,
diff --git a/be/src/olap/rowset/column_data.cpp b/be/src/olap/rowset/column_data.cpp
index 57b0db4..cc8cec7 100644
--- a/be/src/olap/rowset/column_data.cpp
+++ b/be/src/olap/rowset/column_data.cpp
@@ -418,11 +418,11 @@ void ColumnData::set_read_params(const std::vector<uint32_t>& return_columns,
                                  const std::vector<uint32_t>& seek_columns,
                                  const std::set<uint32_t>& load_bf_columns,
                                  const Conditions& conditions,
-                                 const std::vector<ColumnPredicate*>& col_predicates,
+                                 std::shared_ptr<std::vector<ColumnPredicate*>> col_predicates,
                                  bool is_using_cache, RuntimeState* runtime_state) {
     _conditions = &conditions;
-    _col_predicates = &col_predicates;
-    _need_eval_predicates = !col_predicates.empty();
+    _col_predicates = col_predicates;
+    _need_eval_predicates = !col_predicates->empty();
     _is_using_cache = is_using_cache;
     _runtime_state = runtime_state;
     _return_columns = return_columns;
diff --git a/be/src/olap/rowset/column_data.h b/be/src/olap/rowset/column_data.h
index 2e90219..a7974bb 100644
--- a/be/src/olap/rowset/column_data.h
+++ b/be/src/olap/rowset/column_data.h
@@ -62,7 +62,7 @@ public:
     void set_read_params(const std::vector<uint32_t>& return_columns,
                          const std::vector<uint32_t>& seek_columns,
                          const std::set<uint32_t>& load_bf_columns, const Conditions& conditions,
-                         const std::vector<ColumnPredicate*>& col_predicates, bool is_using_cache,
+                         std::shared_ptr<std::vector<ColumnPredicate*>> col_predicates, bool is_using_cache,
                          RuntimeState* runtime_state);
 
     OLAPStatus get_first_row_block(RowBlock** row_block);
@@ -143,7 +143,7 @@ private:
     // 当到达文件末尾或者到达end key时设置此标志
     bool _eof;
     const Conditions* _conditions;
-    const std::vector<ColumnPredicate*>* _col_predicates;
+    std::shared_ptr<std::vector<ColumnPredicate*>> _col_predicates;
     const DeleteHandler* _delete_handler = nullptr;
     DelCondSatisfied _delete_status;
     RuntimeState* _runtime_state;


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