You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2023/04/22 11:18:00 UTC

[doris] 12/15: [fix](compaction) fix potential null pointer dereference (#18915)

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

morningman pushed a commit to branch branch-2.0-alpha
in repository https://gitbox.apache.org/repos/asf/doris.git

commit bcb8f6cbf5d24d6e88fa33c74d65e298e2dcf804
Author: gitccl <60...@users.noreply.github.com>
AuthorDate: Sat Apr 22 08:38:32 2023 +0800

    [fix](compaction) fix potential null pointer dereference (#18915)
---
 be/src/olap/compaction.cpp | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/be/src/olap/compaction.cpp b/be/src/olap/compaction.cpp
index cacf3a9b66..b99a57636d 100644
--- a/be/src/olap/compaction.cpp
+++ b/be/src/olap/compaction.cpp
@@ -414,13 +414,13 @@ Status Compaction::modify_rowsets(const Merger::Statistics* stats) {
                 &location_map, &output_rowset_delete_bitmap);
         std::size_t missed_rows_size = missed_rows.size();
         if (compaction_type() == READER_CUMULATIVE_COMPACTION) {
-            std::string err_msg = fmt::format(
-                    "cumulative compaction: the merged rows({}) is not equal to missed "
-                    "rows({}) in rowid conversion, tablet_id: {}, table_id:{}",
-                    stats->merged_rows, missed_rows_size, _tablet->tablet_id(),
-                    _tablet->table_id());
-            DCHECK(stats == nullptr || stats->merged_rows == missed_rows_size) << err_msg;
             if (stats != nullptr && stats->merged_rows != missed_rows_size) {
+                std::string err_msg = fmt::format(
+                        "cumulative compaction: the merged rows({}) is not equal to missed "
+                        "rows({}) in rowid conversion, tablet_id: {}, table_id:{}",
+                        stats->merged_rows, missed_rows_size, _tablet->tablet_id(),
+                        _tablet->table_id());
+                DCHECK(false) << err_msg;
                 LOG(WARNING) << err_msg;
             }
         }


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