fix row_offset in DDL_MERGE_CO && reset ObIndexBlockMacroIterator before reuse

This commit is contained in:
renju96
2024-02-09 14:34:39 +00:00
committed by ob-robot
parent c5a5b18553
commit f8c1b864f8
3 changed files with 5 additions and 6 deletions

View File

@ -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<ObSSTable *>(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));

View File

@ -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;
}

View File

@ -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
{