From a366348a124b08590a552b14bfa5e292ca24af70 Mon Sep 17 00:00:00 2001 From: obdev Date: Fri, 24 Feb 2023 12:33:46 +0000 Subject: [PATCH] [to #47901724] fix package free ref cursor core --- src/pl/ob_pl_type.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/pl/ob_pl_type.cpp b/src/pl/ob_pl_type.cpp index f46ba1ffa8..3434805bf4 100644 --- a/src/pl/ob_pl_type.cpp +++ b/src/pl/ob_pl_type.cpp @@ -573,10 +573,14 @@ int ObPLDataType::free_session_var(const ObPLResolveCtx &resolve_ctx, ObIAllocat obj.set_null(); } } else if (is_cursor_type()) { - ObPLCursorInfo *cursor = reinterpret_cast(obj.get_ext()); - if (OB_NOT_NULL(cursor)) { - cursor->~ObPLCursorInfo(); - cursor = NULL; + if (is_cursor_var()) { + ObPLCursorInfo *cursor = reinterpret_cast(obj.get_ext()); + if (OB_NOT_NULL(cursor)) { + cursor->~ObPLCursorInfo(); + cursor = NULL; + } + } else { + // do nothing .. package ref cursor only use for cursor parameters, it will close by geneteror. } } else { ObPL *pl_engine = NULL;