add some defensive code and fix ddl mem co and cg sstable row id
This commit is contained in:
@ -76,7 +76,7 @@ int ObDDLIndexBlockRowIterator::init(const ObMicroBlockData &idx_block_data,
|
||||
is_reverse_scan_ = is_reverse_scan;
|
||||
iter_step_ = is_reverse_scan_ ? -1 : 1;
|
||||
datum_utils_ = datum_utils;
|
||||
is_co_sstable_ = iter_param.is_valid() ? iter_param.sstable_->is_co_sstable() || ObITable::TableType::DDL_MEM_CO_SSTABLE == iter_param.sstable_->get_key().table_type_ : false;
|
||||
is_co_sstable_ = iter_param.is_valid() ? iter_param.sstable_->is_co_sstable() || iter_param.sstable_->is_ddl_mem_co_cg_sstable() : false;
|
||||
is_inited_ = true;
|
||||
}
|
||||
return ret;
|
||||
|
||||
@ -103,7 +103,7 @@ int ObSSTableSecMetaIterator::open(
|
||||
}
|
||||
if (OB_FAIL(ret) || is_prefetch_end_) {
|
||||
} else if (is_ddl_mem_sstable) {
|
||||
const bool is_co_sstable = sstable.is_co_sstable() || ObITable::TableType::DDL_MEM_CO_SSTABLE == sstable.get_key().table_type_;
|
||||
const bool is_co_sstable = sstable.is_co_sstable() || sstable.is_ddl_mem_co_cg_sstable();
|
||||
const ObMicroBlockData &root_block = sstable_meta_hdl_.get_sstable_meta().get_root_info().get_block_data();
|
||||
if (ObMicroBlockData::DDL_BLOCK_TREE != root_block.type_ || nullptr == root_block.buf_) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
|
||||
@ -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_; }
|
||||
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 int64_t get_row_count() const { return end_row_id_ - start_row_id_ + 1; }
|
||||
int compare(const ObCSRowId idx) const
|
||||
{
|
||||
|
||||
@ -872,7 +872,7 @@ int ObDDLMemtable::init_ddl_index_iterator(const blocksstable::ObStorageDatumUti
|
||||
blocksstable::ObDDLIndexBlockRowIterator *ddl_kv_index_iter)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
const bool is_co_sst = is_co_sstable();
|
||||
const bool is_co_sst = is_co_sstable() || is_ddl_mem_co_cg_sstable();
|
||||
if (OB_ISNULL(datum_utils) || OB_UNLIKELY(!datum_utils->is_valid()) || OB_ISNULL(ddl_kv_index_iter)) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
LOG_WARN("invalid arguement", K(ret), KP(ddl_kv_index_iter), KPC(datum_utils));
|
||||
|
||||
@ -134,6 +134,7 @@ public:
|
||||
OB_INLINE bool is_major_sstable() const { return ObITable::is_major_sstable(table_type_) || ObITable::is_meta_major_sstable(table_type_); }
|
||||
OB_INLINE bool is_major_or_ddl_merge_sstable() const { return is_major_sstable() || ObITable::is_ddl_merge_sstable(table_type_); }
|
||||
OB_INLINE bool is_ddl_merge_sstable() const { return ObITable::is_ddl_merge_sstable(table_type_); }
|
||||
OB_INLINE bool is_ddl_mem_co_cg_sstable() const { return ObITable::is_ddl_mem_co_cg_sstable(table_type_); }
|
||||
OB_INLINE bool is_meta_major_sstable() const { return ObITable::is_meta_major_sstable(table_type_); }
|
||||
OB_INLINE bool is_multi_version_table() const { return ObITable::is_multi_version_table(table_type_); }
|
||||
OB_INLINE bool is_ddl_sstable() const { return ObITable::is_ddl_sstable(table_type_); }
|
||||
@ -272,6 +273,7 @@ public:
|
||||
virtual bool is_ddl_dump_sstable() const { return is_ddl_dump_sstable(key_.table_type_); }
|
||||
virtual bool is_ddl_mem_sstable() const { return is_ddl_mem_sstable(key_.table_type_); }
|
||||
virtual bool is_ddl_merge_sstable() const { return is_ddl_merge_sstable(key_.table_type_); }
|
||||
virtual bool is_ddl_mem_co_cg_sstable() const { return is_ddl_mem_co_cg_sstable(key_.table_type_); }
|
||||
virtual bool is_remote_logical_minor_sstable() const { return is_remote_logical_minor_sstable(key_.table_type_); }
|
||||
virtual bool is_empty() const = 0;
|
||||
virtual bool no_data_to_read() const { return is_empty(); }
|
||||
@ -417,6 +419,11 @@ public:
|
||||
return ObITable::TableType::DDL_MERGE_CO_SSTABLE == table_type
|
||||
|| ObITable::TableType::DDL_MERGE_CG_SSTABLE == table_type;
|
||||
}
|
||||
static bool is_ddl_mem_co_cg_sstable(const TableType table_type)
|
||||
{
|
||||
return ObITable::TableType::DDL_MEM_CG_SSTABLE == table_type
|
||||
|| ObITable::TableType::DDL_MEM_CO_SSTABLE == table_type;
|
||||
}
|
||||
static bool is_table_with_scn_range(const TableType table_type)
|
||||
{
|
||||
return is_multi_version_table(table_type) || is_meta_major_sstable(table_type);
|
||||
|
||||
Reference in New Issue
Block a user