[bugfix][ret_code]: return 1215 if can't find target index in fk check.

This commit is contained in:
Monk-Liu 2024-02-10 05:40:02 +00:00 committed by ob-robot
parent 0c56e628e0
commit 0008468953
3 changed files with 3 additions and 3 deletions

View File

@ -3423,7 +3423,7 @@ int ObDmlCgService::generate_fk_check_ctdef(const ObLogDelUpd &op,
if (get_fk_check_scan_table_id(name_table_id, name_column_ids, schema_guard, index_tid)) {
LOG_WARN("failed to get foreign key check scan table id", K(name_table_id), K(ret));
} else if (OB_INVALID_ID == index_tid) {
ret = OB_ERR_UNEXPECTED;
ret = OB_ERR_CANNOT_ADD_FOREIGN;
LOG_WARN("invalid index table id to build das scan task for foreign key check", K(ret));
} else if (OB_FAIL(generate_fk_scan_ctdef(schema_guard, index_tid, fk_ctdef.das_scan_ctdef_))) {
LOG_WARN("failed to generate das scan ctdef for foreign key check", K(ret));

View File

@ -1358,7 +1358,7 @@ int ObLogDelUpd::generate_fk_lookup_part_id_expr(IndexDMLInfo &index_dml_info)
} else if (OB_FAIL(parent_table_schema->get_fk_check_index_tid(*schema_guard, fk_info.parent_column_ids_, scan_index_tid))) {
LOG_WARN("failed to get index tid used to build scan das task for foreign key checks", K(ret));
} else if (OB_INVALID_ID == scan_index_tid) {
ret = OB_ERR_UNEXPECTED;
ret = OB_ERR_CANNOT_ADD_FOREIGN;
LOG_WARN("get invalid table id to build das scan task for foreign key checks", K(ret));
} else {
ObRawExpr* fk_look_up_part_id_expr = nullptr;

View File

@ -5408,7 +5408,7 @@ int ObDMLResolver::resolve_fk_table_partition_expr(const TableItem &table_item,
} else if (OB_FAIL(parent_table_schema->get_fk_check_index_tid(*schema_checker_->get_schema_guard(), parent_column_ids, fk_scan_tid))) {
LOG_WARN("failed to get table id to perform scan task for foreign key check", K(ret));
} else if (OB_INVALID_ID == fk_scan_tid) {
ret = OB_ERR_UNEXPECTED;
ret = OB_ERR_CANNOT_ADD_FOREIGN;
LOG_WARN("invalid table id to perform scan task for foregin key check", K(ret));
} else if (OB_FAIL(schema_checker_->get_table_schema(session_info_->get_effective_tenant_id(), fk_scan_tid, resolve_table_schema))) {
LOG_WARN("failed to get table schema to perform foreign key check", K(ret), K(fk_scan_tid));