diff --git a/src/pl/sys_package/ob_dbms_sql.cpp b/src/pl/sys_package/ob_dbms_sql.cpp index 7d2e11738e..9b60dc41ba 100644 --- a/src/pl/sys_package/ob_dbms_sql.cpp +++ b/src/pl/sys_package/ob_dbms_sql.cpp @@ -327,7 +327,7 @@ int ObDbmsInfo::define_column(int64_t col_idx, ObObjType col_type, { int ret = OB_SUCCESS; if (col_idx < 0 || col_idx >= fields_.count()) { - ret = OB_SIZE_OVERFLOW; + ret = OB_ERR_VARIABLE_NOT_IN_SELECT_LIST; LOG_WARN("define column position is invalid", K(col_idx), K(fields_), K(col_type), K(ret)); } else if (!cast_supported(fields_.at(col_idx).type_.get_type(), static_cast(fields_.at(col_idx).charsetnr_), diff --git a/src/sql/ob_spi.cpp b/src/sql/ob_spi.cpp index d20bf3002d..87fd9fb657 100644 --- a/src/sql/ob_spi.cpp +++ b/src/sql/ob_spi.cpp @@ -5585,10 +5585,15 @@ int ObSPIService::spi_set_collection(int64_t tenant_id, CK (type->is_collection_type()); CK (OB_NOT_NULL(collection_type = static_cast(type))); OZ (collection_type->get_element_type().newx(*coll.get_allocator(), ns, ptr)); - if (OB_SUCC(ret) && collection_type->get_element_type().is_collection_type()) { + if (OB_FAIL(ret)) { + } else if (collection_type->get_element_type().is_collection_type()) { ObPLCollection *collection = NULL; CK (OB_NOT_NULL(collection = reinterpret_cast(ptr))); OX (collection->set_count(0)); + } else if (collection_type->get_element_type().is_record_type()) { + ObPLRecord *record = NULL; + CK (OB_NOT_NULL(record = reinterpret_cast(ptr))); + OX (record->set_null()); } OZ (collection_type->get_element_type().get_size(*ns, PL_TYPE_INIT_SIZE, init_size)); OX (row->set_extend(ptr, collection_type->get_element_type().get_type(), init_size)); diff --git a/src/sql/ob_sql.cpp b/src/sql/ob_sql.cpp index 298dd665c5..b12274e948 100644 --- a/src/sql/ob_sql.cpp +++ b/src/sql/ob_sql.cpp @@ -1571,7 +1571,8 @@ int ObSql::handle_pl_execute(const ObString &sql, #endif if (OB_SUCC(ret) && session.get_in_transaction()) { if (ObStmt::is_dml_write_stmt(result.get_stmt_type()) || - ObStmt::is_savepoint_stmt(result.get_stmt_type())) { + ObStmt::is_savepoint_stmt(result.get_stmt_type()) || + (ObStmt::is_select_stmt(result.get_stmt_type()) && OB_NOT_NULL(result.get_physical_plan()) && result.get_physical_plan()->has_for_update())) { session.set_has_exec_inner_dml(true); } } diff --git a/src/sql/resolver/cmd/ob_call_procedure_resolver.cpp b/src/sql/resolver/cmd/ob_call_procedure_resolver.cpp index 008e304a52..8616abd2c6 100644 --- a/src/sql/resolver/cmd/ob_call_procedure_resolver.cpp +++ b/src/sql/resolver/cmd/ob_call_procedure_resolver.cpp @@ -55,6 +55,8 @@ int ObCallProcedureResolver::resolve_cparams(const ParseNode *params_node, ObIArray ¶ms) { int ret = OB_SUCCESS; + bool has_assign_param = false; + CK (OB_NOT_NULL(routine_info)); CK (OB_NOT_NULL(call_proc_info)); @@ -64,7 +66,6 @@ int ObCallProcedureResolver::resolve_cparams(const ParseNode *params_node, } // Step 2: 从ParamsNode中解析参数 if (OB_SUCC(ret) && OB_NOT_NULL(params_node)) { - bool has_assign_param = false; if (T_SP_CPARAM_LIST != params_node->type_) { ret = OB_INVALID_ARGUMENT; LOG_WARN("invalid params list node", K(ret), K(params_node->type_)); @@ -107,7 +108,7 @@ int ObCallProcedureResolver::resolve_cparams(const ParseNode *params_node, } if (OB_SUCC(ret)) { // 判断所有参数没有复杂表达式参数 - bool v = true; + bool v = (false == has_assign_param); for (int64_t i = 0; v && OB_SUCC(ret) && i < params.count(); i ++) { if (OB_ISNULL(params.at(i))) { ret = OB_INVALID_ARGUMENT;