fix dblink type bugs

This commit is contained in:
cqliang1995
2023-06-12 02:43:11 +00:00
committed by ob-robot
parent f6efe78813
commit 9ab529a64b
17 changed files with 265 additions and 116 deletions

View File

@ -145,6 +145,15 @@ int ObCreateDbLinkResolver::resolve(const ParseNode &parse_tree)
LOG_WARN("invalid parse tree", K(ret));
} else if (FALSE_IT(password.assign_ptr(pwd_node->str_value_, static_cast<int32_t>(pwd_node->str_len_)))) {
// do nothing
} else if (password.empty()) {
if (lib::is_oracle_mode()) {
ret = OB_ERR_MISSING_OR_INVALID_PASSWORD;
LOG_USER_ERROR(OB_ERR_MISSING_OR_INVALID_PASSWORD);
} else {
ret = OB_NOT_SUPPORTED;
LOG_USER_ERROR(OB_NOT_SUPPORTED, "create dblink with empty password");
}
LOG_WARN("create dblink with empty password", K(ret));
} else if (OB_FAIL(create_dblink_stmt->set_password(password))) {
LOG_WARN("set password failed", K(ret));
}

View File

@ -236,8 +236,10 @@ int ObRawExprPrinter::print(ObConstRawExpr *expr)
LOG_WARN("fail to print 1 =", K(ret));
} else if (OB_NOT_NULL(param_store_) && 0 <= idx && idx < param_store_->count()) {
OZ (param_store_->at(idx).print_sql_literal(buf_, buf_len_, *pos_, print_params_));
} else if (OB_FAIL(ObLinkStmtParam::write(buf_, buf_len_, *pos_, expr->get_value().get_unknown()))) {
LOG_WARN("fail to write param to buf", K(ret));
} else if (OB_FAIL(ObLinkStmtParam::write(buf_, buf_len_, *pos_,
expr->get_value().get_unknown(),
expr->get_data_type()))) {
LOG_WARN("fail to write param to buf", K(expr->get_value().get_unknown()), K(expr->get_expr_obj_meta()), K(ret));
}
} else if (OB_NOT_NULL(param_store_) && T_QUESTIONMARK == expr->get_expr_type()) {
int64_t idx = expr->get_value().get_unknown();