[to #51509957] fix associative array with init status

This commit is contained in:
obdev
2023-08-24 13:14:06 +00:00
committed by ob-robot
parent 07e87a9f46
commit a61f62e1fd
2 changed files with 7 additions and 2 deletions

View File

@ -4272,7 +4272,12 @@ int ObPLINS::init_complex_obj(ObIAllocator &allocator,
const ObCollectionType *coll_type = static_cast<const ObCollectionType*>(user_type);
CK (OB_NOT_NULL(coll));
OX (set_allocator ? coll->set_allocator(&allocator) : coll->set_allocator(NULL));
OX ((obj.is_ext() && obj.get_ext() != 0) ? (void)NULL : coll->set_inited());
if (OB_FAIL(ret)) {
} else if (user_type->is_associative_array_type()) {
coll->set_inited();
} else {
OX ((obj.is_ext() && obj.get_ext() != 0) ? (void)NULL : coll->set_inited());
}
OX (coll->set_type(pl_type.get_type()));
OZ (get_element_data_type(pl_type, elem_desc, &allocator));
OZ (get_not_null(pl_type, not_null, &allocator));

View File

@ -1812,7 +1812,7 @@ int ObCollectionType::generate_construct(ObPLCodeGenerator &generator,
OX (elem_desc.set_not_null(element_type_.get_not_null()));
OZ (generator.store_elem_desc(elem_desc, element_type_ptr));
OZ (generator.extract_count_ptr_from_collection(value, count_ptr));
OZ (generator.get_helper().create_istore(OB_INVALID_COUNT, count_ptr));
OZ (generator.get_helper().create_istore(is_associative_array_type() ? 0 : OB_INVALID_COUNT, count_ptr));
OZ (generator.extract_first_ptr_from_collection(value, first_ptr));
OZ (generator.get_helper().create_istore(OB_INVALID_INDEX, first_ptr));
OZ (generator.extract_last_ptr_from_collection(value, last_ptr));