From 84d44176d9856d7ced6d00c98d5f44469ffd593f Mon Sep 17 00:00:00 2001 From: chaser-ch Date: Thu, 11 Jul 2024 14:22:30 +0000 Subject: [PATCH] fix miss ret problem --- src/storage/blocksstable/ob_block_sstable_struct.h | 3 ++- src/storage/blocksstable/ob_datum_row.cpp | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/storage/blocksstable/ob_block_sstable_struct.h b/src/storage/blocksstable/ob_block_sstable_struct.h index b5918ee56..01c12afa4 100644 --- a/src/storage/blocksstable/ob_block_sstable_struct.h +++ b/src/storage/blocksstable/ob_block_sstable_struct.h @@ -744,7 +744,8 @@ public: OB_INLINE bool is_valid() const { - return column_cnt_ > 0 && rowkey_cnt_ >= 0; + return column_cnt_ > 0 && rowkey_cnt_ >= 0 + && ObColClusterInfoMask::is_valid_offset_type((ObColClusterInfoMask::BYTES_LEN)offset_type_); } static const int64_t ROW_HEADER_VERSION_1 = 0; diff --git a/src/storage/blocksstable/ob_datum_row.cpp b/src/storage/blocksstable/ob_datum_row.cpp index 104a2d96c..52c9364d8 100644 --- a/src/storage/blocksstable/ob_datum_row.cpp +++ b/src/storage/blocksstable/ob_datum_row.cpp @@ -301,8 +301,10 @@ int ObDatumRow::reserve(const int64_t capacity, const bool keep_data) void *buf = nullptr; if (OB_UNLIKELY(!is_valid())) { + ret = OB_NOT_INIT; STORAGE_LOG(WARN, "ObDatumRow is not inited", K(ret), K(*this)); } else if (OB_UNLIKELY(capacity <= 0 || capacity > 2 * OB_USER_ROW_MAX_COLUMNS_COUNT)) { + ret = OB_INVALID_ARGUMENT; STORAGE_LOG(WARN, "Invalid argument to reserve datum row", K(ret), K(capacity)); } else if (capacity <= get_capacity()) { // skip