From 75ea8c5db656ee2a2420ba27962bfb9d86948df8 Mon Sep 17 00:00:00 2001 From: obdev Date: Thu, 8 Feb 2024 12:42:43 +0000 Subject: [PATCH] [CP] to issue<53973795>:fix package deserialize issue when package table var has default value --- src/pl/ob_pl_user_type.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/pl/ob_pl_user_type.cpp b/src/pl/ob_pl_user_type.cpp index 6b74594826..19966bc92a 100644 --- a/src/pl/ob_pl_user_type.cpp +++ b/src/pl/ob_pl_user_type.cpp @@ -2246,6 +2246,15 @@ int ObCollectionType::deserialize( OZ (ObSPIService::spi_extend_assoc_array( OB_INVALID_ID, &resolve_ctx, *(table->get_allocator()), *assoc_table, count)); } else { + if (table->get_count() > 0) { + for (int64_t i = 0; i < table->get_count(); ++i) { + int tmp_ret = OB_SUCCESS; + if ((tmp_ret = ObUserDefinedType::destruct_obj(table->get_data()[i], &resolve_ctx.session_info_)) != OB_SUCCESS) { + LOG_WARN("failed to destruct obj, memory may leak", K(ret), K(tmp_ret), K(i)); + } + } + } + OX (table->set_count(0)); OZ (ObSPIService::spi_set_collection( OB_INVALID_ID, &resolve_ctx, *table->get_allocator(), *table, count, true)); }