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

@ -171,6 +171,8 @@ int ObTableMergeOp::open_table_for_each()
LOG_WARN("allocate merge rtdef failed", K(ret), K(MY_SPEC.merge_ctdefs_.count()));
} else if (OB_FAIL(ObDMLService::create_rowkey_check_hashset(get_spec().rows_, &ctx_, merge_rtdefs_.at(0).rowkey_dist_ctx_))) {
LOG_WARN("Failed to create hash set", K(ret));
} else if (OB_FAIL(ObDMLService::init_ob_rowkey(ctx_.get_allocator(), MY_SPEC.distinct_key_exprs_.count(), merge_rtdefs_.at(0).table_rowkey_))) {
LOG_WARN("fail to init ObRowkey used for distinct check", K(ret));
}
trigger_clear_exprs_.reset();
for (int64_t i = 0; OB_SUCC(ret) && i < MY_SPEC.merge_ctdefs_.count(); ++i) {
@ -400,11 +402,10 @@ int ObTableMergeOp::check_is_distinct(bool &conflict)
conflict = false;
// check whether distinct only use rowkey
if (OB_FAIL(ObDMLService::check_rowkey_whether_distinct(MY_SPEC.distinct_key_exprs_,
MY_SPEC.distinct_key_exprs_.count(),
MY_SPEC.rows_,
DistinctType::T_HASH_DISTINCT,
get_eval_ctx(),
get_exec_ctx(),
merge_rtdefs_.at(0).table_rowkey_,
merge_rtdefs_.at(0).rowkey_dist_ctx_,
// merge_rtdefs_ length must > 0
is_distinct))) {