Fix dblink bug when dblink sql contains outline
This commit is contained in:
@ -668,7 +668,7 @@ int ObQueryHint::print_stmt_hint(PlanText &plan_text, const ObDMLStmt &stmt,
|
||||
if (OB_FAIL(print_outline_data(plan_text))) {
|
||||
LOG_WARN("failed to print outline data", K(ret));
|
||||
}
|
||||
} else if (!has_outline_data()) {
|
||||
} else if (!has_outline_data() || OB_INVALID_ID != stmt.get_dblink_id()) {
|
||||
// Not outline data, print current stmt hint here.
|
||||
// If stmt is the first stmt can add hint, print global hint and hint with qb name.
|
||||
// For query "select_1 union all select_2", root stmt is "union all" and the first stmt to print hint is select_1
|
||||
|
||||
@ -808,10 +808,10 @@ int ObRawExprPrinter::print(ObOpRawExpr *expr)
|
||||
}
|
||||
case T_OP_BOOL:{
|
||||
CK(1 == expr->get_param_count());
|
||||
if (print_params_.for_dblink_) {
|
||||
DATA_PRINTF("(case when (");
|
||||
if (print_params_.for_dblink_ && lib::is_mysql_mode()) {
|
||||
DATA_PRINTF("!!(");
|
||||
PRINT_EXPR(expr->get_param_expr(0));
|
||||
DATA_PRINTF(") then 1 else 0 end)");
|
||||
DATA_PRINTF(")");
|
||||
} else if (expr->has_flag(IS_INNER_ADDED_EXPR)) {
|
||||
// ignore print inner added expr
|
||||
PRINT_EXPR(expr->get_param_expr(0));
|
||||
|
||||
Reference in New Issue
Block a user