fix some sql logical plan bug

This commit is contained in:
zzg19950727
2024-02-06 19:45:53 +00:00
committed by ob-robot
parent 5b35b464d6
commit 58b436c230
9 changed files with 257 additions and 47 deletions

View File

@ -3350,6 +3350,21 @@ int ObSql::prepare_outline_for_phy_plan(ObLogPlan *logical_plan,
phy_plan->stat_.outline_data_.assign_ptr(buf, static_cast<ObString::obstr_size_t>(plan_text.pos_));
}
}
if (OB_FAIL(ret)) {
} else if (OB_UNLIKELY(NULL == (tmp_ptr = phy_plan->get_allocator().alloc(OB_MAX_SQL_LENGTH)))) {
ret = OB_ALLOCATE_MEMORY_FAILED;
LOG_ERROR("fail to alloc memory", K(ret));
} else if (FALSE_IT(buf = static_cast<char *>(tmp_ptr))) {
} else {
PlanText plan_text;
plan_text.buf_ = buf;
plan_text.buf_len_ = OB_MAX_SQL_LENGTH;
if (OB_FAIL(ObSqlPlan::get_plan_used_hint_info_one_line(plan_text, logical_plan))) {
LOG_WARN("failed to get plan used hint info", K(ret));
} else {
phy_plan->stat_.hints_info_.assign_ptr(buf, static_cast<ObString::obstr_size_t>(plan_text.pos_));
}
}
return ret;
}