Fix dblink bugs

This commit is contained in:
xianyu-w
2023-02-24 15:10:13 +00:00
committed by ob-robot
parent fa839089d7
commit 8e6297fb78
14 changed files with 117 additions and 144 deletions

View File

@ -682,15 +682,9 @@ int ObTransformSimplifySubquery::recursive_add_limit_for_exists_expr(ObRawExpr *
ObSelectStmt *subquery = NULL;
ObOpRawExpr *op = static_cast<ObOpRawExpr*>(expr);
ObQueryRefRawExpr *subq_expr = static_cast<ObQueryRefRawExpr *>(op->get_param_expr(0));
bool from_one_dblink = false;
if (OB_ISNULL(subq_expr) || OB_ISNULL(subquery = subq_expr->get_ref_stmt())) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("get unexpected null ptr", K(ret), K(subq_expr), K(subquery));
} else if (OB_FAIL(ObTransformUtils::check_stmt_from_one_dblink(subquery, from_one_dblink))) {
LOG_WARN("failed to check if all tables from one dblink", K(ret));
} else if (from_one_dblink) {
// do not transform,
// for compatibility with Oracle before 12c
} else if (!subquery->has_limit() && !subquery->is_contains_assignment()) {
if (OB_FAIL(ObTransformUtils::set_limit_expr(subquery, ctx_))) {
LOG_WARN("add limit expr failed", K(*subquery), K(ret));