[CP] [to #54116671] fix serval pl bugs
This commit is contained in:
@ -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<const ObCollectionType*>(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<ObPLCollection*>(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<ObPLRecord*>(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));
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,6 +55,8 @@ int ObCallProcedureResolver::resolve_cparams(const ParseNode *params_node,
|
||||
ObIArray<ObRawExpr*> ¶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;
|
||||
|
||||
Reference in New Issue
Block a user