fix: fix the bug induced by check delete distinct for foreign key cascade delete

This commit is contained in:
obdev
2023-02-14 08:11:51 +00:00
committed by ob-robot
parent 1ea5d6dfc9
commit f6009fdcb4
8 changed files with 161 additions and 61 deletions

View File

@ -701,13 +701,16 @@ int ObTableModifyOp::inner_close()
}
}
dml_modify_rows_.clear();
// Release the hash sets created at root ctx for delete distinct check
if (OB_SUCC(ret) && get_exec_ctx().is_root_ctx()) {
// Release the hash sets created at fk root ctx for delete distinct checks
if (OB_SUCC(ret) && get_exec_ctx().is_fk_root_ctx()) {
DASDelCtxList& del_ctx_list = get_exec_ctx().get_das_ctx().get_das_del_ctx_list();
DASDelCtxList::iterator iter = del_ctx_list.begin();
for (; OB_SUCC(ret)&& iter != del_ctx_list.end(); iter++) {
DmlRowkeyDistCtx del_ctx = *iter;
del_ctx.deleted_rows_->destroy();
if (del_ctx.deleted_rows_ != nullptr) {
del_ctx.deleted_rows_->destroy();
del_ctx.deleted_rows_ = nullptr;
}
}
del_ctx_list.destroy();
}