Reject drop table only when drop index

This commit is contained in:
Hongqin-Li
2022-11-11 03:07:24 +00:00
committed by wangzelin.wzl
parent 5c2a7ab5d9
commit 618341bd5d
2 changed files with 5 additions and 2 deletions

View File

@ -1440,7 +1440,10 @@ int ObDDLTaskRecordOperator::check_has_conflict_ddl(
} else if (task_record.task_id_ != task_id) {
switch (ddl_type) {
case ObDDLType::DDL_DROP_TABLE: {
if (task_record.ddl_type_ == ObDDLType::DDL_DROP_INDEX && task_record.target_object_id_ != task_record.object_id_) {
LOG_WARN("conflict with ddl", K(task_record));
has_conflict_ddl = true;
}
break;
}
default: {

View File

@ -18229,7 +18229,7 @@ int ObDDLService::drop_table(const ObDropTableArg &drop_table_arg, const obrpc::
if (table_schema->get_table_type() == MATERIALIZED_VIEW || table_schema->is_tmp_table()) {
to_recyclebin = false;
}
if (OB_FAIL(ObDDLTaskRecordOperator::check_has_conflict_ddl(
if (drop_table_arg.table_type_ == USER_TABLE && OB_FAIL(ObDDLTaskRecordOperator::check_has_conflict_ddl(
sql_proxy_,
drop_table_arg.tenant_id_,
table_schema->get_table_id(),