[CP] [CP] Fix reference count leak when stmt_info expires

This commit is contained in:
obdev
2022-08-25 18:14:54 +08:00
committed by wangzelin.wzl
parent 649a2dc6f7
commit 4e81072cd2
7 changed files with 95 additions and 17 deletions

View File

@ -729,7 +729,7 @@ int ObSql::handle_ps_prepare(const ObString &stmt, ObSqlCtx &context, ObResultSe
stmt_info->set_is_expired();
ps_sql_key.set_db_id(stmt_info->get_db_id());
ps_sql_key.set_ps_sql(stmt_info->get_ps_sql());
if (OB_FAIL(ps_cache->erase_stmt_item(ps_sql_key))) {
if (OB_FAIL(ps_cache->erase_stmt_item(inner_stmt_id, ps_sql_key))) {
LOG_WARN("fail to erase stmt item", K(ret), K(*stmt_info));
}
need_do_real_prepare = true;