fix last_trace_id expr bug in remote execution

This commit is contained in:
obdev
2022-11-02 23:35:48 +00:00
committed by wangzelin.wzl
parent 2d58c1fc74
commit 833107d931
8 changed files with 23 additions and 5 deletions

View File

@ -45,12 +45,12 @@ int ObExprLastTraceId::eval_last_trace_id(const ObExpr &expr, ObEvalCtx &ctx,
{
int ret = OB_SUCCESS;
UNUSED(expr);
const ObSQLSessionInfo *session_info = NULL;
if (OB_ISNULL(session_info = ctx.exec_ctx_.get_my_session())) {
const ObPhysicalPlanCtx *phy_plan_ctx = NULL;
if (OB_ISNULL(phy_plan_ctx = ctx.exec_ctx_.get_physical_plan_ctx())) {
ret = OB_ERR_UNEXPECTED;
SQL_ENG_LOG(WARN, "session info is null", K(ret));
} else {
const ObCurTraceId::TraceId &trace_id = session_info->get_last_trace_id();
const ObCurTraceId::TraceId &trace_id = phy_plan_ctx->get_last_trace_id();
if (trace_id.is_invalid()) {
expr_datum.set_null();
} else {