[CP] fix partition wise join and global index lookup -4016

This commit is contained in:
leslieyuchen
2023-11-02 05:12:51 +00:00
committed by ob-robot
parent 52efbcb6b0
commit 38d3830962
2 changed files with 40 additions and 13 deletions

View File

@ -1652,6 +1652,9 @@ bool ObTableScanOp::need_real_rescan()
bool bret = false;
if (!MY_SPEC.batch_scan_flag_) {
bret = true;
} else if (tsc_rtdef_.bnlj_params_.empty()) {
//batch rescan not init, need to do real rescan
bret = true;
} else {
ObPhysicalPlanCtx *plan_ctx = GET_PHY_PLAN_CTX(ctx_);
int64_t param_idx = tsc_rtdef_.bnlj_params_.at(0).param_idx_;
@ -3059,7 +3062,10 @@ int ObGlobalIndexLookupOpImpl::close()
int ObGlobalIndexLookupOpImpl::rescan()
{
int ret = OB_SUCCESS;
if (get_batch_rescan() && lookup_group_cnt_ < index_group_cnt_) {
if (OB_ISNULL(table_scan_op_)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("table scan op not init", K(ret));
} else if (!table_scan_op_->need_real_rescan() && lookup_group_cnt_ < index_group_cnt_) {
LOG_DEBUG("rescan in group lookup, only need to switch iterator",
K(lookup_group_cnt_), K(index_group_cnt_));
if (OB_FAIL(table_scan_op_->build_bnlj_params())) {