fix some bugs

This commit is contained in:
ChangerR
2023-11-10 06:39:12 +00:00
committed by ob-robot
parent 8b6b9d8df0
commit 7d7c37db03
4 changed files with 275 additions and 290 deletions

View File

@ -190,6 +190,7 @@ int ObOptimizer::generate_plan_for_temp_table(ObDMLStmt &stmt)
ObSelectStmt *ref_query = NULL;
ObSelectLogPlan *temp_plan = NULL;
ObLogicalOperator *temp_op = NULL;
ObShardingInfo *sharding_info = NULL;
for (int64_t i = 0; OB_SUCC(ret) && i < temp_table_infos.count(); i++) {
ObRawExpr *temp_table_nonwhere_filter = NULL;
ObRawExpr *temp_table_where_filter = NULL;
@ -224,10 +225,18 @@ int ObOptimizer::generate_plan_for_temp_table(ObDMLStmt &stmt)
LOG_WARN("Failed to generate temp_plan for sub_stmt", K(ret));
} else if (OB_FAIL(temp_plan->get_candidate_plans().get_best_plan(temp_op))) {
LOG_WARN("failed to get best plan", K(ret));
} else if (OB_FAIL(temp_plan->choose_duplicate_table_replica(temp_op,
ctx_.get_local_server_addr(),
true))) {
LOG_WARN("failed to choose duplicate table replica", K(ret));
} else if (OB_ISNULL(temp_op)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("get unexpected null", K(ret));
} else {
sharding_info = temp_op->get_strong_sharding();
if (NULL != sharding_info && sharding_info->get_can_reselect_replica()) {
sharding_info->set_can_reselect_replica(false);
}
if (NULL != temp_table_nonwhere_filter) {
ObSEArray<ObRawExpr *, 1> expr_array;
if (OB_FAIL(expr_array.push_back(temp_table_nonwhere_filter))) {