Fix a bug when allocate shared expr in link stmt
This commit is contained in:
@ -1880,6 +1880,8 @@ int ObLogicalOperator::add_expr_to_ctx(ObAllocExprContext &ctx,
|
|||||||
if (OB_ISNULL(expr)) {
|
if (OB_ISNULL(expr)) {
|
||||||
ret = OB_ERR_UNEXPECTED;
|
ret = OB_ERR_UNEXPECTED;
|
||||||
LOG_WARN("get unexpected null", K(ret));
|
LOG_WARN("get unexpected null", K(ret));
|
||||||
|
} else if (log_op_def::LOG_LINK_SCAN == get_type()) {
|
||||||
|
// do not extract shared exprs for link op
|
||||||
} else if (OB_FAIL(extract_shared_exprs(expr,
|
} else if (OB_FAIL(extract_shared_exprs(expr,
|
||||||
ctx,
|
ctx,
|
||||||
0,
|
0,
|
||||||
|
|||||||
@ -451,6 +451,19 @@ int ObTransformDBlink::pack_link_table(ObDMLStmt *stmt, bool &trans_happened)
|
|||||||
LOG_TRACE("succeed to pack one link stmt", K(helpers.at(i)));
|
LOG_TRACE("succeed to pack one link stmt", K(helpers.at(i)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (stmt->is_set_stmt()) {
|
||||||
|
ObSelectStmt *sel_stmt = static_cast<ObSelectStmt *>(stmt);
|
||||||
|
for (int64_t i = 0; OB_SUCC(ret) && i < sel_stmt->get_set_query().count(); ++i) {
|
||||||
|
ObSelectStmt *child_stmt = sel_stmt->get_set_query(i);
|
||||||
|
if (OB_ISNULL(child_stmt)) {
|
||||||
|
ret = OB_ERR_UNEXPECTED;
|
||||||
|
LOG_WARN("unexpected null", K(ret));
|
||||||
|
} else if (!child_stmt->is_dblink_stmt()) {
|
||||||
|
// do nothing
|
||||||
|
} else if (OB_FAIL(ObTransformUtils::pack_stmt(ctx_, static_cast<ObSelectStmt *>(child_stmt)))) {
|
||||||
|
LOG_WARN("failed to pack link stmt", K(ret));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user