[CP] to issue<57878473>:fix memory leak about signal stmt in mysql mode

This commit is contained in:
hanr881 2024-07-15 15:17:05 +00:00 committed by ob-robot
parent 11eb878dd8
commit aff2232ed0
2 changed files with 5 additions and 1 deletions

View File

@ -707,6 +707,10 @@ int ObPLResolver::resolve(const ObStmtNodeTree *parse_tree, ObPLFunctionAST &fun
&& lib::is_mysql_mode()) {
ObPLSignalStmt *signal_stmt = NULL;
int save_ret = ret;
if (NULL != stmt) {
stmt->~ObPLStmt();
stmt = NULL;
}
if (OB_FAIL(stmt_factory_.allocate(PL_SIGNAL, current_block_, stmt))) {
LOG_WARN("failed to alloc stmt", K(ret));
} else if (OB_ISNULL(signal_stmt = static_cast<ObPLSignalStmt*>(stmt))) {

View File

@ -2962,7 +2962,7 @@ public:
inline void set_is_signal_null() { is_signal_null_ = true; }
inline bool is_signal_null() const { return is_signal_null_; }
inline int create_item_to_expr_idx(int64_t capacity) {
return item_to_expr_idx_.create(capacity, ObModIds::OB_PL_TEMP);
return item_to_expr_idx_.create(capacity, "PlStmtHashMap", ObModIds::OB_HASH_NODE, MTL_ID());
}
inline const int64_t *get_expr_idx(const int64_t item) const { return item_to_expr_idx_.get(item); }
inline const hash::ObHashMap<int64_t, int64_t>& get_item_to_expr_idx() const