From ae6eea62f174c744c468fb55f268b506389278b0 Mon Sep 17 00:00:00 2001 From: xianyu-w <707512433@qq.com> Date: Thu, 9 Mar 2023 12:47:20 +0000 Subject: [PATCH] Fix a dblink bug and disable pdml hint for dblink --- src/sql/resolver/dml/ob_hint.cpp | 4 +++- src/sql/rewrite/ob_transform_simplify_subquery.cpp | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/sql/resolver/dml/ob_hint.cpp b/src/sql/resolver/dml/ob_hint.cpp index 398fa6e45b..72c2dc2722 100644 --- a/src/sql/resolver/dml/ob_hint.cpp +++ b/src/sql/resolver/dml/ob_hint.cpp @@ -448,7 +448,9 @@ int ObGlobalHint::print_global_hint(PlanText &plan_text, const bool ignore_paral } if (OB_SUCC(ret) && ObPDMLOption::NOT_SPECIFIED != pdml_option_) { //PDML if (ObPDMLOption::ENABLE == pdml_option_) { - PRINT_GLOBAL_HINT_STR("ENABLE_PARALLEL_DML"); + if (!ignore_parallel) { + PRINT_GLOBAL_HINT_STR("ENABLE_PARALLEL_DML"); + } } else if (ObPDMLOption::DISABLE == pdml_option_) { PRINT_GLOBAL_HINT_STR("DISABLE_PARALLEL_DML"); } else { diff --git a/src/sql/rewrite/ob_transform_simplify_subquery.cpp b/src/sql/rewrite/ob_transform_simplify_subquery.cpp index 71862339f0..86cdbe3551 100644 --- a/src/sql/rewrite/ob_transform_simplify_subquery.cpp +++ b/src/sql/rewrite/ob_transform_simplify_subquery.cpp @@ -1463,8 +1463,8 @@ int ObTransformSimplifySubquery::eliminate_subquery_in_exists(ObDMLStmt *stmt, } else if (OB_FAIL(ObOptimizerUtil::remove_item(stmt->get_subquery_exprs(), subq_expr))) { LOG_WARN("remove expr failed", K(ret)); } else { - ObConstRawExpr *c_expr = NULL; - if (OB_FAIL(ObRawExprUtils::build_const_int_expr(*expr_factory, ObIntType, (T_OP_EXISTS == expr->get_expr_type()), c_expr))) { + ObRawExpr *c_expr = NULL; + if (OB_FAIL(ObRawExprUtils::build_const_bool_expr(expr_factory, c_expr, (T_OP_EXISTS == expr->get_expr_type())))) { LOG_WARN("failed to create expr", K(ret)); } else if (OB_ISNULL(c_expr)) { ret = OB_ERR_UNEXPECTED;