[CP] fix invalid keypart bug

This commit is contained in:
Larry955
2023-05-23 09:23:01 +00:00
committed by ob-robot
parent 2bc0002996
commit ff770ce5c8
2 changed files with 10 additions and 1 deletions

View File

@ -1174,6 +1174,12 @@ int ObKeyPart::formalize_keypart(bool contain_row)
LOG_WARN("failed to adjust in param values", K(ret));
}
}
if (OB_SUCC(ret) && is_in_key() &&
(in_keypart_->in_params_.empty() || in_keypart_->get_param_val_cnt() == 0)) {
if (OB_FAIL(convert_to_true_or_false(false))) {
LOG_WARN("failed to convert to always true");
}
}
}
return ret;
}

View File

@ -2877,7 +2877,10 @@ int ObQueryRange::get_multi_in_key_part(const ObOpRawExpr *l_expr,
LOG_WARN("failed to adjust in param values", K(ret));
} else if (OB_FAIL(tmp_key_part->formalize_keypart(contain_row_))) {
LOG_WARN("failed to formalize in key", K(ret));
} else {
} else if (tmp_key_part->is_always_true() || tmp_key_part->is_always_false()) {
query_range_ctx_->cur_expr_is_precise_ = false;
}
if (OB_SUCC(ret)) {
out_key_part = tmp_key_part;
}
}