diff --git a/src/sql/engine/cmd/ob_routine_executor.cpp b/src/sql/engine/cmd/ob_routine_executor.cpp index 32f46aa025..6c83328efa 100644 --- a/src/sql/engine/cmd/ob_routine_executor.cpp +++ b/src/sql/engine/cmd/ob_routine_executor.cpp @@ -230,8 +230,8 @@ int ObCallProcedureExecutor::execute(ObExecContext &ctx, ObCallProcedureStmt &st } } } else { - ret = OB_ERR_UNEXPECTED; - LOG_WARN("invalid out param expr", K(*expr), K(ret)); + ret = OB_ERR_CALL_WRONG_ARG; + LOG_WARN("PLS-00306: wrong number or types of arguments in call stmt", K(ret)); } } else { ctx.get_physical_plan_ctx()->get_param_store_for_update().at(i) = params.at(i); diff --git a/src/sql/resolver/cmd/ob_call_procedure_resolver.cpp b/src/sql/resolver/cmd/ob_call_procedure_resolver.cpp index c68c26fb63..f607bded7e 100644 --- a/src/sql/resolver/cmd/ob_call_procedure_resolver.cpp +++ b/src/sql/resolver/cmd/ob_call_procedure_resolver.cpp @@ -478,24 +478,6 @@ int ObCallProcedureResolver::resolve(const ParseNode &parse_tree) *(params_.allocator_), *(params_.sql_proxy_), pl_type)); - if (OB_FAIL(ret)) { - } else if (params_.is_prepare_protocol_ - && params_.is_prepare_stage_ - && param_expr->get_expr_type() != T_QUESTIONMARK) { - // do nothing ... - } else if (!param_info->is_extern_type()) { - } else { - if (OB_SUCC(ret)) { - //not support complex param not in prepare, except default value - if (pl_type.is_user_type()) { - if (!params_.is_prepare_protocol_ - && !param_expr->has_flag(IS_PL_MOCK_DEFAULT_EXPR)) { - ret = OB_ERR_CALL_WRONG_ARG; - LOG_WARN("PLS-00306: wrong number or types of arguments in call stmt", K(ret)); - } - } - } - } } if (OB_SUCC(ret)) { if (param_info->is_out_sp_param() || param_info->is_inout_sp_param()) { diff --git a/src/sql/resolver/dml/ob_del_upd_resolver.cpp b/src/sql/resolver/dml/ob_del_upd_resolver.cpp index 819f54b423..916ff48a29 100644 --- a/src/sql/resolver/dml/ob_del_upd_resolver.cpp +++ b/src/sql/resolver/dml/ob_del_upd_resolver.cpp @@ -2282,10 +2282,16 @@ int ObDelUpdResolver::expand_record_to_columns(const ParseNode &record_node, const pl::ObUserDefinedType *user_type = NULL; ParseNode *column_node = NULL; const ParseNode *member_node = &record_node; - bool multi_level_count = 0; + int64_t multi_level_count = 0; while (NULL != member_node && member_node->num_child_ > 1 && NULL != member_node->children_[1]) { + if (NULL != member_node->children_[0] && + T_IDENT == member_node->children_[0]->type_ && + T_OBJ_ACCESS_REF == member_node->children_[1]->type_) { + // do nothing + } else { + multi_level_count++; + } member_node = member_node->children_[1]; - multi_level_count++; } if (multi_level_count > 0) { ret = OB_NOT_SUPPORTED; diff --git a/src/sql/resolver/dml/ob_dml_resolver.cpp b/src/sql/resolver/dml/ob_dml_resolver.cpp index ce1423d620..de1507ba5b 100755 --- a/src/sql/resolver/dml/ob_dml_resolver.cpp +++ b/src/sql/resolver/dml/ob_dml_resolver.cpp @@ -2665,6 +2665,16 @@ int ObDMLResolver::resolve_columns(ObRawExpr *&expr, ObArray &c && OB_FAIL(check_col_param_on_expr(expr))) { LOG_WARN("illegal param on func_expr", K(ret)); } + if (OB_SUCC(ret) && OB_NOT_NULL(expr) && + T_QUESTIONMARK == expr->get_expr_type() && + ObExtendType == expr->get_result_type().get_type() && + ((NULL == params_.secondary_namespace_ && NULL == session_info_->get_pl_context()) || + (current_scope_ != T_FIELD_LIST_SCOPE && current_scope_ != T_FROM_SCOPE && current_scope_ != T_INTO_SCOPE) || + (get_basic_stmt()->is_insert_stmt() && current_scope_ == T_INTO_SCOPE))) { + ret = OB_NOT_SUPPORTED; + LOG_WARN("dml with collection or record construction function is not supported", K(ret)); + LOG_USER_ERROR(OB_NOT_SUPPORTED, "dml with collection or record construction function is"); + } return ret; } @@ -2720,7 +2730,15 @@ int ObDMLResolver::resolve_qualified_identifier(ObQualifiedName &q_name, is_external = false; } } else if (T_FUN_PL_OBJECT_CONSTRUCT == real_ref_expr->get_expr_type()) { - is_external = false; + if ((NULL == params_.secondary_namespace_ && NULL == session_info_->get_pl_context()) || + (current_scope_ != T_FIELD_LIST_SCOPE && current_scope_ != T_INTO_SCOPE) || + (get_basic_stmt()->is_insert_stmt() && current_scope_ == T_INTO_SCOPE)) { + ret = OB_NOT_SUPPORTED; + LOG_WARN("dml with collection or record construction function is not supported", K(ret)); + LOG_USER_ERROR(OB_NOT_SUPPORTED, "dml with collection or record construction function is"); + } else { + is_external = false; + } } } else if (lib::is_oracle_mode() && q_name.col_name_.length() == 0) { //对于长度为0的identifier报错和oracle兼容 @@ -2742,8 +2760,27 @@ int ObDMLResolver::resolve_qualified_identifier(ObQualifiedName &q_name, ret = OB_NOT_SUPPORTED; LOG_WARN("dml with collection or record construction function is not supported", K(ret)); LOG_USER_ERROR(OB_NOT_SUPPORTED, "dml with collection or record construction function is"); - } else if ((ObExtendType == real_ref_expr->get_result_type().get_type() - || ObMaxType == real_ref_expr->get_result_type().get_type()) + } else if (ObExtendType == real_ref_expr->get_result_type().get_type() && + T_FUN_PL_SQLCODE_SQLERRM != real_ref_expr->get_expr_type() && + (!ob_is_xml_pl_type(real_ref_expr->get_data_type(), real_ref_expr->get_udt_id()))) { + bool is_support = false; + const ObUserDefinedType *user_type = NULL; + uint64_t udt_id = real_ref_expr->get_result_type().get_udt_id(); + OZ (params_.secondary_namespace_->get_pl_data_type_by_id(udt_id, user_type)); + CK (OB_NOT_NULL(user_type)); + if (OB_SUCC(ret) && user_type->is_udt_type()) { + is_support = true; + } + if (OB_SUCC(ret)) { + if (!is_support) { + ret = OB_NOT_SUPPORTED; + LOG_WARN("dml with collection or record construction function is not supported", K(ret)); + LOG_USER_ERROR(OB_NOT_SUPPORTED, "dml with collection or record construction function is"); + } else { + is_external = true; + } + } + } else if ((ObMaxType == real_ref_expr->get_result_type().get_type()) && (T_FUN_PL_SQLCODE_SQLERRM != real_ref_expr->get_expr_type()) && (!ob_is_xml_pl_type(real_ref_expr->get_data_type(), real_ref_expr->get_udt_id()))) { ret = OB_NOT_SUPPORTED;