diff --git a/src/storage/blocksstable/index_block/ob_ddl_index_block_row_iterator.cpp b/src/storage/blocksstable/index_block/ob_ddl_index_block_row_iterator.cpp index e582e6276b..d3ef4984e2 100644 --- a/src/storage/blocksstable/index_block/ob_ddl_index_block_row_iterator.cpp +++ b/src/storage/blocksstable/index_block/ob_ddl_index_block_row_iterator.cpp @@ -574,6 +574,7 @@ int ObDDLSStableAllRangeIterator::locate_key(const ObDatumRowkey &rowkey) ret = OB_INVALID_ARGUMENT; LOG_WARN("invalid rowkey", K(ret), K(rowkey)); } else { + index_macro_iter_.reset(); ObDatumRange range; range.set_start_key(rowkey); range.set_end_key(rowkey); @@ -601,6 +602,7 @@ int ObDDLSStableAllRangeIterator::locate_range(const ObDatumRange &range, { int ret = OB_SUCCESS; ObSSTable *sstable = const_cast(iter_param_.sstable_); + index_macro_iter_.reset(); if (IS_NOT_INIT) { ret = OB_NOT_INIT; LOG_WARN("Iter not opened yet", K(ret), KPC(this)); diff --git a/src/storage/blocksstable/index_block/ob_index_block_builder.cpp b/src/storage/blocksstable/index_block/ob_index_block_builder.cpp index 063a53622c..d5fd49b860 100644 --- a/src/storage/blocksstable/index_block/ob_index_block_builder.cpp +++ b/src/storage/blocksstable/index_block/ob_index_block_builder.cpp @@ -107,9 +107,8 @@ int ObIndexTreeRootCtx::init(common::ObIAllocator &allocator) */ bool ObIndexTreeRootCtx::is_absolute_vaild(const bool is_cg) const { - // @wenqu: after adapting the offset, delete "//" return (!use_absolute_offset_&& absolute_offsets_ == nullptr) || - // (use_absolute_offset_ && !is_cg && absolute_offsets_ != nullptr) || + (use_absolute_offset_ && !is_cg && absolute_offsets_ != nullptr) || (use_absolute_offset_ && is_cg && absolute_offsets_ == nullptr); } @@ -813,9 +812,7 @@ int ObSSTableIndexBuilder::merge_index_tree(ObSSTableMergeRes &res) } else if (use_absolute_offset && index_store_desc_.get_desc().is_cg()) { //ddl cg absolute_row_offset = macro_meta->val_.row_count_ + row_idx; } else if (use_absolute_offset && !index_store_desc_.get_desc().is_cg()) { //ddl co - absolute_row_offset = macro_meta->val_.row_count_ + row_idx; - // TODO:@wenqu: after adapting the offset, use the following code to replace the above code. - // absolute_row_offset = roots_[i]->absolute_offsets_->at(j); + absolute_row_offset = roots_[i]->absolute_offsets_->at(j); } else { absolute_row_offset = macro_meta->val_.row_count_ + row_idx; } diff --git a/src/storage/column_store/ob_column_store_util.h b/src/storage/column_store/ob_column_store_util.h index dcce19b0d7..65eb800f4f 100644 --- a/src/storage/column_store/ob_column_store_util.h +++ b/src/storage/column_store/ob_column_store_util.h @@ -62,7 +62,7 @@ struct ObCSRange OB_INLINE ObCSRowId begin() const { return start_row_id_; } OB_INLINE ObCSRowId end() const { return end_row_id_; } OB_INLINE void reset() { start_row_id_ = OB_INVALID_CS_ROW_ID; end_row_id_ = OB_INVALID_CS_ROW_ID; } - OB_INLINE bool is_valid() const { return OB_INVALID_CS_ROW_ID != start_row_id_ && end_row_id_ >= start_row_id_ && end_row_id_ >= 0; } + OB_INLINE bool is_valid() const { return start_row_id_ >= 0 && end_row_id_ >= start_row_id_; } OB_INLINE int64_t get_row_count() const { return end_row_id_ - start_row_id_ + 1; } int compare(const ObCSRowId idx) const {