fix temp table access rescan bug
This commit is contained in:
@ -170,9 +170,39 @@ OB_SERIALIZE_MEMBER_INHERIT(ObTempTableAccessVecOpSpec, ObOpSpec,
|
||||
int ObTempTableAccessVecOp::inner_rescan()
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
is_started_ = false;
|
||||
int64_t result_id = 0;
|
||||
cur_idx_ = 0;
|
||||
return ObOperator::inner_rescan();
|
||||
is_started_ = false;
|
||||
can_rescan_ = true;
|
||||
if (!MY_SPEC.is_distributed_) {
|
||||
interm_result_ids_.reuse();
|
||||
if (OB_FAIL(get_local_interm_result_id(result_id))) {
|
||||
LOG_WARN("failed to get local result id", K(ret));
|
||||
} else if (OB_FAIL(interm_result_ids_.push_back(result_id))) {
|
||||
LOG_WARN("failed to push back result id", K(ret));
|
||||
}
|
||||
} else {
|
||||
int64_t index = 0;
|
||||
bool is_end = false;
|
||||
while (!is_end && OB_SUCC(ret)) {
|
||||
if (OB_FAIL(check_status())) {
|
||||
LOG_WARN("check status failed", K(ret));
|
||||
} else
|
||||
if (OB_FAIL(MY_INPUT.check_finish(is_end, index))) {
|
||||
LOG_WARN("failed to check finish.", K(ret));
|
||||
} else if (!is_end) {
|
||||
result_id = MY_INPUT.interm_result_ids_.at(index);
|
||||
if (OB_FAIL(interm_result_ids_.push_back(result_id))) {
|
||||
LOG_WARN("failed to push back result id", K(ret));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (OB_SUCC(ret) &&
|
||||
OB_FAIL(ObOperator::inner_rescan())) {
|
||||
LOG_WARN("failed to rescan", K(ret));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObTempTableAccessVecOp::inner_open()
|
||||
@ -243,7 +273,6 @@ int ObTempTableAccessVecOp::inner_get_next_batch(const int64_t max_row_cnt)
|
||||
if (is_end) {
|
||||
brs_.size_ = 0;
|
||||
brs_.end_ = true;
|
||||
can_rescan_ = true;
|
||||
} else {
|
||||
brs_.size_ = read_rows;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user