提交 f3d6b18e 编写于 作者: T Tyshawn 提交者: ob-robot

[FTS][BUG.FIX] Fix both full-text and multi-value indexs in data table.

上级 8aade630
......@@ -234,7 +234,16 @@ void ObDASDMLIterator::set_ctdef(const ObDASDMLBaseCtDef *das_ctdef)
&das_ctdef_->old_row_projector_ :
&das_ctdef_->new_row_projector_;
if (OB_NOT_NULL(domain_iter_)) {
domain_iter_->set_ctdef(das_ctdef, row_projector_);
if (!das_ctdef->table_param_.get_data_table().is_domain_index()) {
// This table isn't domain index, nothing to do.
} else if (domain_iter_->is_same_domain_type(das_ctdef)) {
// The das_ctdef and das_ctdef_ are either full-text search or multi-value index.
domain_iter_->set_ctdef(das_ctdef, row_projector_);
} else {
// need to reset domain iter
domain_iter_->~ObDomainDMLIterator();
domain_iter_ = nullptr;
}
}
}
......
......@@ -490,6 +490,20 @@ void ObDomainDMLIterator::set_ctdef(
row_projector_ = row_projector;
}
bool ObDomainDMLIterator::is_same_domain_type(const ObDASDMLBaseCtDef *das_ctdef) const
{
bool is_same_domain_type = false;
if (OB_NOT_NULL(das_ctdef) && OB_NOT_NULL(das_ctdef_)) {
const ObTableSchemaParam &table_param = das_ctdef->table_param_.get_data_table();
const ObTableSchemaParam &my_table_param = das_ctdef_->table_param_.get_data_table();
if ((table_param.is_fts_index() && my_table_param.is_fts_index())
|| (table_param.is_multivalue_index() && my_table_param.is_multivalue_index())) {
is_same_domain_type = true;
}
}
return is_same_domain_type;
}
int ObDomainDMLIterator::get_next_domain_row(ObNewRow *&row)
{
int ret = OB_SUCCESS;
......
......@@ -106,6 +106,7 @@ public:
void set_ctdef(const ObDASDMLBaseCtDef *das_ctdef, const IntFixedArray *row_projector);
void set_row_projector(const IntFixedArray *row_projector) { row_projector_ = row_projector; }
int get_next_domain_row(ObNewRow *&row);
bool is_same_domain_type(const ObDASDMLBaseCtDef *das_ctdef) const;
TO_STRING_KV(K_(row_idx), K_(rows), KPC_(row_projector), KPC_(das_ctdef), K_(main_ctdef));
protected:
......
......@@ -73,10 +73,19 @@ public:
iter_has_built_ = false;
das_ctdef_ = static_cast<const ObDASUpdCtDef*>(das_ctdef);
if (OB_NOT_NULL(domain_iter_)) {
domain_iter_->set_ctdef(das_ctdef_, &(got_old_row_ ? das_ctdef_->new_row_projector_
: das_ctdef_->old_row_projector_));
if (OB_FAIL(domain_iter_->rewind())) {
LOG_WARN("fail to rewind for domain iterator", K(ret));
if (!das_ctdef->table_param_.get_data_table().is_domain_index()) {
// This table isn't domain index, nothing to do.
} else if (domain_iter_->is_same_domain_type(das_ctdef)) {
// The das_ctdef and das_ctdef_ are either full-text search or multi-value index.
domain_iter_->set_ctdef(das_ctdef_, &(got_old_row_ ? das_ctdef_->new_row_projector_
: das_ctdef_->old_row_projector_));
if (OB_FAIL(domain_iter_->rewind())) {
LOG_WARN("fail to rewind for domain iterator", K(ret));
}
} else {
// need to reset domain iter
domain_iter_->~ObDomainDMLIterator();
domain_iter_ = nullptr;
}
}
return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册